Connecting Tech Pros Worldwide Help | Site Map

Ticked on another table

Newbie
 
Join Date: May 2007
Location: Malaysia
Posts: 2
#1: May 25 '07
Hi, Im beginner in Access and I got problem with my form.

My form (frmRegistration)
-save all the data key in by the user to the table Registration
-also need to tick the Register field at table Room when clicked the button save

My problem is all the data can be saved successful but I dont know how to tick the Register field which is at the other table.

This is my tables:
Registration(RegistrationID,CustomerID,RoomID,Star tDate,EndDate)
Room(RoomID,RoomNo,BlockID,TypeID,PriceID,Register ,Notes)

Im really newbie in Access and need help. Anyone, please teach me well.
Thank you.
msquared's Avatar
Administrator
 
Join Date: Aug 2006
Location: Dublin, Ireland
Posts: 10,865
#2: May 26 '07

re: Ticked on another table


You need something like the following code.
Expand|Select|Wrap|Line Numbers
  1. Dim strSQL As String
  2.  
  3.    strSQL = "UPDATE Room Set Register = True WHERE RoomID=" & Me!RoomID
  4.    DoCmd.RunSQL strSQL
  5.  
Newbie
 
Join Date: May 2007
Location: Malaysia
Posts: 2
#3: May 28 '07

re: Ticked on another table


Quote:

Originally Posted by mmccarthy

You need something like the following code.

Expand|Select|Wrap|Line Numbers
  1. Dim strSQL As String
  2.  
  3.    strSQL = "UPDATE Room Set Register = True WHERE RoomID=" & Me!RoomID
  4.    DoCmd.RunSQL strSQL
  5.  

Thanks for the reply. Where can I put those code. Is it in the save button or After Update event? And with the code, did I need to add the checkbox in the form?
Reply