form help

ChrisDo11

Registered User.
Local time
Today, 14:22
Joined
Jan 21, 2003
Messages
69
on entering my form you enter a job number, it then pulls then job name in from another table. next you put in a description. i have multiple descriptions to enter under the same job number and job name.

After i enter the first description, i want to be able to click a button to take me to the next record, only i want it to remember the job number and job name into the next record so the user doesn't have to type in the job number for each description..... is this possible?

Thanks,
 
Are you adding new records or moving through existing records?

Either way, something along these lines should work when put behind the click event of your command button.


Dim intJobNumber as Integer, strJobName as String
intJobNumber = txtJobNumber
strJobName = txtJobName
DoCmd.GotoRecord , , acNew
txtJobNumber = intJobNumber
txtJobName = strJobName

That would work for adding a new record

changing one line to DoCmd.GotoRecord , , acNext would fix the next in an existing recordset
 
Store the information you want to bring forward in the tag (property) of the field being brough forward. Then on a new record stuff the filed from the tag.

i.e.

on the form BeforeUpdate event:
me!textbox.tag=me!textbox

then on the new record OncurrentEvent:
if nz(me!textbox.tag) <> 0 then me!textbox = me!textbox.tag.

Depending on your form, you may have to initialize the tag values to Null.

A technically better method would keep descriptions in a second table with a intJobNumber field for linking, then display the description in a subform (linked by intJobNumber) on your form. Add records to your hearts desire. Why do you need multiple records with repreated information? That violates one of the normal rules.
 

Users who are viewing this thread

Back
Top Bottom