Hi,
I'm using Access 2000.
I currently use two forms, one to enter my [customers] info, then other to enter the [products] they want to buy.
Once I've entered the customers details, I want to be able to press a button and it open up a new record in the [products] and already show the customers unique ID.
I've followed the wizard and it does open up the [products] form, and it does bring the unique ID, but it doesn't start a new record, it overwrites the existing data!
Here's the code I'm currently using, can anyone see what I'm doing wrong please? or know of any tutorials that could help me? I've ordered an Access Bible but it won't arrive for a few days.
Private Sub new_request_Click()
On Error GoTo Err_new_request_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "ProductsEntryForm"
stLinkCriteria = "[Performed for Customer]=" & Me![CustomerID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_new_request_Click:
Exit Sub
Err_new_request_Click:
MsgBox Err.Description
Resume Exit_new_request_Click
End Sub
Any help would be greatly appreciated!
Many thanks,
Dean
I'm using Access 2000.
I currently use two forms, one to enter my [customers] info, then other to enter the [products] they want to buy.
Once I've entered the customers details, I want to be able to press a button and it open up a new record in the [products] and already show the customers unique ID.
I've followed the wizard and it does open up the [products] form, and it does bring the unique ID, but it doesn't start a new record, it overwrites the existing data!
Here's the code I'm currently using, can anyone see what I'm doing wrong please? or know of any tutorials that could help me? I've ordered an Access Bible but it won't arrive for a few days.
Private Sub new_request_Click()
On Error GoTo Err_new_request_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "ProductsEntryForm"
stLinkCriteria = "[Performed for Customer]=" & Me![CustomerID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_new_request_Click:
Exit Sub
Err_new_request_Click:
MsgBox Err.Description
Resume Exit_new_request_Click
End Sub
Any help would be greatly appreciated!
Many thanks,
Dean