2 forms , Rental_F and Car_F .
Rental_F is a form for user to key in values,
Car_F has Fixed values.
i need to compare the ID in Rental_F and ID in Car_F
If the ID match, then check the status in Car_F , if Available then the Rental_F save the record, else return a message.
i have bad coding T...T
Pls hlp me to fixed this coding.
Save button named addRental, [Event Procedure]
Private Sub addRental_Click()
DoCmd.OpenForm "Rental_F"
DoCmd.OpenForm "Car_F"
IIF (Forms![Car_F]![txtID]=Forms![Rental_F]![ID])And
(Forms![Car_F]![txtstatus]="Available")Then
DoCmd.RunCommand acCmdSaveRecord
Else
MsgBox "This Car Is Currently Not Available", vbInformation, "Error"
End If
End Sub