i am having some problems with some code i am trying to write. I want to open up a sales form for a customer. I am keeping it to one sale per each customer. the problem i am having is i want a NEW form to open for each customer. After the new form has been opened and data has been entered and closed. I want the same form again to be opened this time in EDIT mode if the sale already exists.
Is it possible have some sort of field check before opening the form?
What is the code i need to write?
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Sales"
stLinkCriteria = "[ContractNumber]=" & "'" & Me![ContractNumber] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
-----
will open a NEW form in add mode, how do i implement an if statement to check the fields in both customer and sales before opening?
cheers
Is it possible have some sort of field check before opening the form?
What is the code i need to write?
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Sales"
stLinkCriteria = "[ContractNumber]=" & "'" & Me![ContractNumber] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
-----
will open a NEW form in add mode, how do i implement an if statement to check the fields in both customer and sales before opening?
cheers