If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Help with code to run query and test a field in the record
Tried the following and get the message too few parameters
expected 3. The following statement gets highlighted: Set rs = db.OpenRecordset("QueryAv") Any idea? Thanks Dim db As DAO.Database Dim rs As DAO.Recordset Set db = CurrentDb() Set rs = db.OpenRecordset("QueryAv") If rs![Booking ID] = 1 Then DoCmd.OpenForm "SINGLE BOOKING DETAIL" End If rs.Close : Set rs = Nothing Set db = Nothing MVP [MS Access] |
#2
|
|||
|
|||
Help with code to run query and test a field in the record
Post the SQL String of your QueryAv.
Do you use Parameters in this Query? If you do, you need to resolve the Parameters before passing to JET for processing. -- HTH Van T. Dinh MVP (Access) "Kate" wrote in message ... Tried the following and get the message too few parameters expected 3. The following statement gets highlighted: Set rs = db.OpenRecordset("QueryAv") Any idea? Thanks Dim db As DAO.Database Dim rs As DAO.Recordset Set db = CurrentDb() Set rs = db.OpenRecordset("QueryAv") If rs![Booking ID] = 1 Then DoCmd.OpenForm "SINGLE BOOKING DETAIL" End If rs.Close : Set rs = Nothing Set db = Nothing MVP [MS Access] |
#3
|
|||
|
|||
Help with code to run query and test a field in the record
hi Van.
Kate did post the SQL, in a separate thread 3:59 pm this date, subject line: I'm struggling with my limited knowledge of code. i posted an answer, but maybe you'll come up with something better on looking at it? tina "Van T. Dinh" wrote in message ... Post the SQL String of your QueryAv. Do you use Parameters in this Query? If you do, you need to resolve the Parameters before passing to JET for processing. -- HTH Van T. Dinh MVP (Access) "Kate" wrote in message ... Tried the following and get the message too few parameters expected 3. The following statement gets highlighted: Set rs = db.OpenRecordset("QueryAv") Any idea? Thanks Dim db As DAO.Database Dim rs As DAO.Recordset Set db = CurrentDb() Set rs = db.OpenRecordset("QueryAv") If rs![Booking ID] = 1 Then DoCmd.OpenForm "SINGLE BOOKING DETAIL" End If rs.Close : Set rs = Nothing Set db = Nothing MVP [MS Access] |
#4
|
|||
|
|||
Help with code to run query and test a field in the record
Yes.
There are 3 Parameters that need to be resolved before passing the SQL String to JET for processing. They a Forms![SINGLE BOOKING AVAILABILITY]!BookingDate Forms![SINGLE BOOKING AVAILABILITY]!Combo8 Forms![SINGLE BOOKING AVAILABILITY]!Combo10 Note that JET Database Engine which process the SQL String does not know anything about Forms or Controls on Form so these need to be replaced with actual values before passing the SQL String to JET for processing. -- HTH Van T. Dinh MVP (Access) "tina" wrote in message ... hi Van. Kate did post the SQL, in a separate thread 3:59 pm this date, subject line: I'm struggling with my limited knowledge of code. i posted an answer, but maybe you'll come up with something better on looking at it? tina |
Thread Tools | |
Display Modes | |
|
|