Whilst my code is working OK.
It currently updates the [Location] based on the [DepartmentBookingOut] field.
In the PoolBookings form, the user selects the [DepartmentBookingOut] from a List Box. Almost all departments should be in the box, however in case they aren't, I added another field in the PoolBookings table called [DepartmentBookingOutNotInList].
The way the code is set up at the moment, will work perfectly as long as the user selects the correct [DepartmentBookingOut].
I wanted to use an IF statement within an IF statement. I don't know whether this is possible.
I want the IF statement to look at whether the [DeparmentBookingOut] is null, so I'm guessing it would look like this...
When I run this I get an Object Required message.
It currently updates the [Location] based on the [DepartmentBookingOut] field.
In the PoolBookings form, the user selects the [DepartmentBookingOut] from a List Box. Almost all departments should be in the box, however in case they aren't, I added another field in the PoolBookings table called [DepartmentBookingOutNotInList].
The way the code is set up at the moment, will work perfectly as long as the user selects the correct [DepartmentBookingOut].
I wanted to use an IF statement within an IF statement. I don't know whether this is possible.
I want the IF statement to look at whether the [DeparmentBookingOut] is null, so I'm guessing it would look like this...
Code:
Dim db As DAO.Database
If [DepartmentBookingOut] Is Null Then
Me.Location = Me.DepartmentBookingOutNotInList
Else
Me.Location = Me.DepartmentBookingOut
End If
When I run this I get an Object Required message.