I have a button which runs an update query. When the user clicks on the button, a pop-up appears asking the user to enter the missing info (e.g. [ENTER ID NUMBER] and [ENTER STAFF NAME] - This will update records with the Staff name they enter based on the ID they enter)I want to change the query based on some sort of IF statement.
The button currently just runs the query and the pop-up appears because in the 'Update To' and 'Criteria' fields, I've entered [ENTER STAFF NAME] and [ENTER ID NUMBER].Below is the idea but I don't know how to get it to work.
The button currently just runs the query and the pop-up appears because in the 'Update To' and 'Criteria' fields, I've entered [ENTER STAFF NAME] and [ENTER ID NUMBER].Below is the idea but I don't know how to get it to work.
Code:
IF [KeepSeprate] = False 'KeepSeperate is a Yes/No Checkbox Field'
THEN UPDATE
[Staff Name] & [Staff Name2] = [ENTER SAFF NAME] 'This is where the user enters he Staff Name'
[DateAllocated] & [DateAllocated2] = Date()
WHERE [ID] = [ENTER ID] 'This is where the user enters the ID'
IF [KeepSeprate] = True 'KeepSeperate is a Yes/No Checkbox Field'
THEN UPDATE
[Staff Name] = [ENTER STAFF NAME] 'This is where the user enters he Staff Name'
[DateAllocated] = Date()
WHERE [ID] = [ENTER ID] 'This is where the user enters the ID'