Dmax And Record

Wes28

Registered User.
Local time
Yesterday, 23:16
Joined
Dec 4, 2009
Messages
60
I have two table's one has my serial numbers in it. The other just stores info.

When I click on a button. It does a Dmax look up.

Nz(DMax("fieldToBeChecked", "sourceTable", "anyCriteria"), 0) + 1

Which I think i get..

My issue is how do you update this Number to record the new number to the table the serial number comes from?

Thanks
 
Typically you are using that method to populate a control/field in that table. For instance, behind a save button on a form bound to that table you might have:

Me.SerialNumber = Nz(...) + 1
 
Thanks pbaldy,

The serial number i have in question would go into an unbound text box first. Then I copy on the on update command to ReSerialNum

Table1
SerialNum<-- Serial number would index to next number.

Table2
EmpNum
JobNum
ReSerialNum<--- to record the Serial number.


Would like to use the serial Number for tracking purposes. As there will be many steps added. Not sure if this explains any better..
If you have a better solution or a better way of doing the above. I would be willing to give it a try.

Thanks
 
Use the function insert into

CurrentDb.Execute "INSERT INTO [Table2] (ReSerialNum) VALUES (& "SerialNum" &);"
 

Users who are viewing this thread

Back
Top Bottom