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

Populate fields based on a record from another table? 1

Status
Not open for further replies.

Tasuki

MIS
Jul 26, 2002
169
0
0
US
Hi,

I have 2 forms, one form is the default value form, and the other is a regular form.

-The default value form will have common values that are used frequently in the regular form.

-The regular form, will look up the current default values and populate them to the related field.

This is to help in repetitive data entry. So once the user has filled out the default values that they want, they can use the regular form to fill out records continuously until the default values are no longer used in the data entry (they'd have to go into the default value form and change it for the next set of data entry).

What I'm having trouble with is getting the regular form to lookup the default value and populate it upon entering the form. How would I populate the fields based on fields from another form?

Thanks for your time and looking,

-T
 
Hmm, I think I've got it using the DLookup function.

Is there any way to use DLookup to pull the value of the last record inputted?

It would be much better than having to reset the default form if the DLookup can populate certain fields based on the last entry received...

Hopefully there's a way to do that, will continue looking.

-T
 
Take a look in the FAQ area for carry

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks PH,

Looks like the solution I'm looking for, although I keep getting an error using it.

Always getting a syntax error at:

If ctl.tag = "CarryForward"

I think I did everything as specified. I changed the After Update event to the code for Multiple Controls, and change the Control Tag property to CarryForward... proceeded to fill in the fields and when done, I receive the syntax error...is there anything I may be missing?

Thanks again,

-T
 
Replace this:
If ctl.Tag = "CarryForward"
By this:
If ctl.Tag = "CarryForward" Then

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks, that works great now.

The ErrorHandler part doesn't seem to work, saying it's undefined or something, but I commented it out and it works. The code is not 100% perfect because after exiting the form and re-entering a new form, it only seems to carry over data from the very first carry over (and not the last record) - strange, but it carries over everything after that as long as I do not close the form.

Thanks PHV and to the FAQ-writer, this will suffice for heavy-duty data entry.
 
The ErrorHandler part doesn't seem to work
In the bottom of the FAQ is a link to send a comment to the FAQ-writer.
Feel free to use it ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top