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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Speed up inputs 1

Status
Not open for further replies.

mxp346

MIS
Apr 27, 2002
50
US
I have a form that when the user fills it out with an ID, Description, Category and Occurance Number, the inputs are stored in an Occurance table. There is another table that has the ID's listed and has the associated Description and Category. So that the user doesn't have to input the Description and Category every time, I wanted those values to be looked up based on the ID typed in and then placed in text boxes on the form . How do I go about doing this? What properties do I need to change?
 
During the ID field After Update
Open The RecordSet Fetch the values
and place them in the respective text boxes
 
I don't have the tables linked because I was just using the one table to lookup the other values after the person enters the ID.
 
Just open the connection to the required DB
Use the connection And open recordset and try in that way
 
Check out the DLOOKUP action - it does exactly what you want.

txtDescription = Dlookup("Description", "OtherTable", "OtherTableID = '" & Forms!YourForm!YourInputID & "'")

(Assuming YourInputID is a text guy - the single quotes are needed. If not,

Dlookup("Description", "OtherTable", "OtherTableID = " & forms!YourForm!YourInputID )


Jim How many of you believe in telekinesis? Raise my hand...
Another free Access forum:
More Access stuff at
 
The Dlookup function worked well. Now I got the form working. I made an add record button to save the information to tblOccurance. When I click it, nothing is added to the database. Do I need to write a macro and place it in the On Click Property of the button? If so what is the action property that should be used?
 
I finally figured it out. Thank you for all your help.
 
Actually it's still not working :/ It doesn't save the values that were looked up to the table. So I have the control source as =DLookup... It looks up the values right but when I click the fields that have DLookup in them don't save to the database, only the values that the person enters.
 
You really don't need to save the values again - if they are in a lookup table, just use them when ever you need them, either via a join query, or with the DLOOKUP function.

It's considered bad form to store a value in two separate places (except for joining keys, obviously)

Jim How many of you believe in telekinesis? Raise my hand...
Another free Access forum:
More Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top