Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help in writing 2 simple modules, 1 4 saving & the other query

Status
Not open for further replies.

njpaco

Technical User
Nov 27, 2001
5
US
I'm trying to make a simply database, but i haven't done one in over 4 years. I'm using access 2000. I made the tables and all the forms but i don't have an idea how to write two modules. The first one is a save command button, I want to this button to save information from a textbox to a particle column in the database.
The second one is to query from a textbox and refresh the other textboxs with the information that it retrieved. Can some please help me. I've been looking at access 2000 book and i'm lost and my time is running out to have this complete. Thank you in advance for you help.
 
Can you elaborate a little on this. How did you retrieve the data from the database? Is the form bound? Have you used ADO?
 
Assuming your form is bound, both of these functions can be created autmatically by access. Select the command button item from the form design toolbox, & make sure the wizard item at the top of the toolbox is highlighted. Placing the command button will trigger the wizard. You can then select Record Operations (I think) & it will walk you through the creation of a save button. I believe Misc Operations will give you the option to run a query...


HTH James Goodman
 
if anyone is would like know how to write a module to save a record using textboxs. here it is I finally got it.

Private Sub Command3_Click()

Dim dbsa As Database, rst As Variant

Set dbsa = CurrentDb
Set rst = dbsa.OpenRecordset("table")

rst.AddNew
rst![field1] = Me.Form.field1
rst![field2] = Me.Form.field2
rst![field3] = Me.Form.field3
rst.Update
Me.field1 = Null
Me.field2 = Null
Me.field3 = Null

rst.Close

End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top