Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 12:54 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Databases - Part 3: Adding Records to a Database
PostPosted: October 25th, 2004, 3:44 pm 
Offline

Joined: October 25th, 2004, 12:27 pm
Posts: 526
Location: Digital Workshop
Q: I am now able to display records from the database and allow the user to search for records. However, I now wish to allow the user to add new records to the database. Is this possible?

A: Yes - this is possible. The following steps should allow you to modify the publication created in the first two tutorials to allow for the addition of new records:

1) Open the example publication with which you have been working throughout the previous two tutorials
2) Add a text input box to the page
3) In the properties of the text input box, select the Text Input tab and click on the "New" button
4) Create a new publication variable named NEWNAME with a default blank text value
5) Click Apply and OK
6) Now repeat steps 2-5 to create two more text input boxes, assigning the first to a new publication variable named NEWAGE (with a default blank text value) and the second to a new publication variable named NEWOCCUPATION (again with a blank text value)
7) Add a button object to the page
8) In the actions for the button, select the Database group of actions
9) Double-click on the Insert New Record action
10) Open the drop-down menu for the DSN field and select the DSN you created in Part 1
11) Open the drop-down menu for the Table field and select 'Table1' from the list provided
12) You should now see all of the fields from the database appear in the grid below the DSN and Table fields
13) Click on the NAME field to highlight it
14) Enable the Variable radio button
15) Now open the drop-down menu for the Variable field and select the NEWNAME variable
16) Click on the AGE field to highlight it
17) Enable the Variable radio button
18) Now open the drop-down menu for the Variable field and select the NEWAGE variable
19) Click on the OCCUPATION field to highlight it
20) Enable the Variable radio button
21) Now open the drop-down menu for the Variable field and select the NEWOCCUPATION variable
22) Click Apply and OK to confirm the changes
23) Now preview the publication
24) Input some values into the three text input boxes (although the search input field should be left blank)
25) Click the button underneath the three input fields to submit the information

To test that the information has been correctly added, simply exit out of preview mode, open your database back into Microsoft Access and view the contents of Table1. The inputted values should now appear as the last record in the table.


For this message Robin Garrett has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group