|
-
Feb 8th, 2000, 12:41 PM
#1
Thread Starter
New Member
Okay, Ive recently learned how to make simple databases but I still can't figure out how to create an Add Button that will create a whole new record in my Access Database. Preferably i'd like the user to click the button and all the text fields on the screen become empty and the user can enter the new information into it. If anyone can help, please do. =)
-
Feb 8th, 2000, 01:00 PM
#2
Member
In the ADD button click event
'clear all your text boxes
text1.text = ""
text2.text = ""
and so on.
or write a procedure to clear all the text boxes and call it
-
Feb 8th, 2000, 06:06 PM
#3
Hyperactive Member
To clear the text boxes if you have them set up as an array
For i = 0 to 9 'where you have 10 text boxes
text(i) = ""
Next
Then when you are happy that the user has entered their data you can use a SQL insert statement to update your database, this statement could be behind a 'Save' command button.
-
Feb 8th, 2000, 08:22 PM
#4
Thread Starter
New Member
Actually, I was wondering if the Add button could clear all the fields (which has been mentioned how to solve) but instead of having to update the database after the information is entered, but just to have the fields automatically be the new record when you clicked the add button. That way the new record would already be there with nothing for data, which the user would then enter
-
Feb 9th, 2000, 06:26 AM
#5
Addicted Member
if you're using DAO and datacontrol with bound textboxes, you can just invoke the addnew method of the recordest in the ADD button click event. All bound textboxes will be cleared and a new record is created, all automatically
Code:
private sub cmdAdd_click()
data1.recordset.addnew
end sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|