ha got another problem now:
i want to click on a button which will look at a number in a field on a form, open up the new form, and find that number. If the number is not in the table, it shows a blank (this is the part i was doing a minute ago) I can get everything to work on their specific forms but i want it all to happen in the click of one button. At the moment, they click on the button and it finds the record. I have another button which recognises the field is blank and will take the user to the other form. I want the first button to find the record if there is a match, and go to the other form if there is not.
The code i have at the moment is this: (sorry if its rubbish, im quite new 2 all of this)
(This part is when the button is clicked on the first form, and a customer number has been written in text2. Customer number is in a different table, and is the thing i am searching on. This works by the way)
stDocName2 ="frmStock"
stDocName = "frmAllocate"
stLinkCriteria= "[CustomerNumber]=" & "'" & Me![text2] & "'"
DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria
I then have the records appear which match the customer number. I then have, for the button on the form which has opened...)
stDocName = "frmStock"
If IsNull(txtCustomerNumber.Value) Then
MsgBox"There are no items reserved for this customer"
DoCmd.OpenForm stDocName
End If
(This again works fine, but obviously, the customer can already see that the box is blank and can tell no items have been reserved by themselves. Instead of showing this, i want it to go straight to the next form.)
I think ive repeated myself many times here, and made a complete mess of what im trying to ask, but if you understand, please try and help!
Thanks again,
Emily