Add a new record to a subform?

charliemopps

Registered User.
Local time
Today, 11:35
Joined
Feb 24, 2009
Messages
40
the long and short of it:
I have 2 tables:
tbl_Tickets
tbl_Updates
They are linked via a common field, ticket number

in the tbl_Updates I have
Ticekt number
USRID
Working
TimeStamp

I want that when a user opens a ticket in tbl_Tickets (via a button) it creates a new record in tbl_Updates with the same ticket number as tbl_tickets and stampts the USRID and Now() into 'Working'
A querry will prevent other users from picking up this record while they work it. (until a certain time frame has passed)
Then, when they complete it, they click a different button and it stamps 'Timestamp'.

I have no idea how to use VB to create new record in different table.
Can anyone point me to an example of how this is done?

Thanks!
 
If you use the subform wizard, Access will ensure that the link field is populated in any new record in the subform. So if you set the subform to Data Entry and the default value of Working to Now(), you're almost there. The you need to add the control that is bound to Timestamp into the Before Update event of the subform.
 
If you use the subform wizard, Access will ensure that the link field is populated in any new record in the subform. So if you set the subform to Data Entry and the default value of Working to Now(), you're almost there. The you need to add the control that is bound to Timestamp into the Before Update event of the subform.

The 1 problem I have with your idea is that I DONT want the user to be able to edit that subform other than with the button.

Also, what VB code do I use to create a new record in a subform that's in continuous forms mode? It lists all matching time stamps based on ticket number. I just want to add another.
tbl_Tickets
tbl_Updates
frm_Tickets
subfrm_Updates
 

Users who are viewing this thread

Back
Top Bottom