M
Martin Pigott via AccessMonster.com
I am fairly new to Access and need to make a travel request booking form. I
want to make certain fields enable or disable when for example the
Flight_Req_d check box is selected. I have managed to get the certain
fields to sort of work but have struck a problem that I could do with some
help.
Each field to do with 'Flights' are set so they are disabled on opening the
form initially from the field properties box. Then on clicking the
Flight_Req_d check box they all become enabled and data can then be
entered. Problem is that when I go to the next record all those fields will
be enabled although the check box is not selected. Also if I go back to
the record that had previously had flight data entered in, they are all
disabled. I was quite chuffed that I had actually got it working in the
first instance, but now I am stuck. Having read several threads, theres a
lot of clever people out there, that I am sure this is really easy to
solve.
The code attached to the Flight_Req_d check box I created, which I am sure
is really messy, but it sort of works is as follows:
Private Sub Flight_Req_d_Click()
Airline.Enabled = True
Departure_Airport.Enabled = True
Arrival_Airport.Enabled = True
Flights.Enabled = True
Flight_No_Out.Enabled = True
Flight_No_In.Enabled = True
Flight_Cost.Enabled = True
Flight_Booked.Enabled = True
Book_Ref.Enabled = True
Notes.Enabled = True
If Flight_Req_d = 0 Then
Airline.Enabled = False
Departure_Airport.Enabled = False
Arrival_Airport.Enabled = False
Flights.Enabled = False
Flight_No_Out.Enabled = False
Flight_No_In.Enabled = False
Flight_Cost.Enabled = False
Flight_Booked.Enabled = False
Book_Ref.Enabled = False
Notes.Enabled = False
End If
End Sub
Any help would gratefully be recieved.
Cheers
MP
want to make certain fields enable or disable when for example the
Flight_Req_d check box is selected. I have managed to get the certain
fields to sort of work but have struck a problem that I could do with some
help.
Each field to do with 'Flights' are set so they are disabled on opening the
form initially from the field properties box. Then on clicking the
Flight_Req_d check box they all become enabled and data can then be
entered. Problem is that when I go to the next record all those fields will
be enabled although the check box is not selected. Also if I go back to
the record that had previously had flight data entered in, they are all
disabled. I was quite chuffed that I had actually got it working in the
first instance, but now I am stuck. Having read several threads, theres a
lot of clever people out there, that I am sure this is really easy to
solve.
The code attached to the Flight_Req_d check box I created, which I am sure
is really messy, but it sort of works is as follows:
Private Sub Flight_Req_d_Click()
Airline.Enabled = True
Departure_Airport.Enabled = True
Arrival_Airport.Enabled = True
Flights.Enabled = True
Flight_No_Out.Enabled = True
Flight_No_In.Enabled = True
Flight_Cost.Enabled = True
Flight_Booked.Enabled = True
Book_Ref.Enabled = True
Notes.Enabled = True
If Flight_Req_d = 0 Then
Airline.Enabled = False
Departure_Airport.Enabled = False
Arrival_Airport.Enabled = False
Flights.Enabled = False
Flight_No_Out.Enabled = False
Flight_No_In.Enabled = False
Flight_Cost.Enabled = False
Flight_Booked.Enabled = False
Book_Ref.Enabled = False
Notes.Enabled = False
End If
End Sub
Any help would gratefully be recieved.
Cheers
MP