473,386 Members | 1,602 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Ticked on another table

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.
May 25 '07 #1
2 1110
MMcCarthy
14,534 Expert Mod 8TB
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.  
May 26 '07 #2
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?
May 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: terence.parker | last post by:
I am often faced with the dilemma of whether to use a JOIN query across three tables in order to grab a bunch of results - or whether to create another table to represent what I want. The latter is...
2
by: Daniel | last post by:
I use an Access database to basically take data exports, import them, manipulate the data, and then turn them into exportable reports. I do this using numerous macros, and queries to get the data...
5
by: jaking01 | last post by:
Hi. I am currently working on a form that I need to prevent changes to after data has been input. There are a series of tick boxes on the form, and when each one of these is ticked it spawns...
6
by: DP | last post by:
hi, i've got a film rental database., with a film table and form. i've got a checkbox in the form called 'available'. i;ve got a lblOnRent underneath. i just want it to say the film is on rent...
3
by: Eric | last post by:
When i run my query it transfer last 4 digits of account number from one table to another and its wrong. There are two tables one i use for parsing. Second thru query i use to move data from temp...
9
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to...
3
by: connieyongg | last post by:
hi, Lets consider if i have to display my data dynamically using ASP ( the no of data to be displayed is an unknown), My data will be in this format Checkbox_1 data_1a data_1b Checkbox_2...
5
by: Rex | last post by:
Hi, I want to change a value in one table depending on the value(s) in another table. I am trying to achieve this in a form. to elaborate I have a many-to-many relationship between tables...
6
by: MikeSA | last post by:
Hi Probably an old question.... I'm trying to run an update query which needs to update files in a table if a check box is ticked. Please advise. Thanks! MikeSA
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.