Hello, im trying to open a form from an dialog box form:
the button on the dialog box has this on the onclick event:
DoCmd.OpenForm "frmCASES_UNION ", acViewNormal, , "MCH_CASECO DE = #" &
Me!txtCCODE & "#"
the form I'm trying to open is "frmcases_union "
and im trying to filter it by the "MCH_CASECO DE" which i type into
txtCCODE.
When i click i get:
Run-time error 3705
Syntax error in date in query expression MCH_CASECODE = #1360#
is it because im using # signs which makes it think its a date?? what
should i use as placeholders?
Thanks, Gavin 3 11809
On Wed, 14 Nov 2007 22:09:46 -0000, ga*****@yahoo.c om wrote:
Hello, im trying to open a form from an dialog box form:
the button on the dialog box has this on the onclick event:
DoCmd.OpenForm "frmCASES_UNION ", acViewNormal, , "MCH_CASECO DE = #" &
Me!txtCCODE & "#"
the form I'm trying to open is "frmcases_union "
and im trying to filter it by the "MCH_CASECO DE" which i type into
txtCCODE.
When i click i get:
Run-time error 3705
Syntax error in date in query expression MCH_CASECODE = #1360#
is it because im using # signs which makes it think its a date?? what
should i use as placeholders?
Thanks, Gavin
Why are you using
"MCH_CASECO DE = #" Me!txtCCODE & "#" ?
The # is a date delimiter symbol. By your surrounding your variable
with #, Access is expecting a date value, but MCH_CASECODE is not a
date field.
What is the datatype of the "MCH_CASECO DE" field?
If MCH_CASECODE is Text datatype, then use:
"MCH_CASECO DE ='" & Me!txtCCODE & "'"
The above will return the 1360 value as text:
"MCH_CASECO DE = '1360'"
If it is a Number datatype then use:
"MCH_CASECO DE =" & Me!txtCCODE
The above will return the 1360 value as a Number
"MCH_CASECO DE = 1360"
I would suspect that you need the Number datatype syntax.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Yes, the # is used as delimiters around literal dates in the string.
If MCH_CASECODE is a Text field (when you open the field in design view),
use quote marks. Example:
Dim strWhere As String
If Not IsNull(Me.txtCC CODE) Then
strWhere = "MCH_CASECO DE = """ & Me!txtCCODE & """"
End If
DoCmd.OpenForm "frmCASES_UNION ", acViewNormal, , strWhere
By using a variable for the WhereCondition, you can add the line:
Debug.Print strWhere
and see what it prints to the Debug window if it fails.
For an explanation of the extra quotes, see:
Quotation marks within quotes
at: http://allenbrowne.com/casu-17.html
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
<ga*****@yahoo. comwrote in message
news:11******** **************@ 22g2000hsm.goog legroups.com...
Hello, im trying to open a form from an dialog box form:
the button on the dialog box has this on the onclick event:
DoCmd.OpenForm "frmCASES_UNION ", acViewNormal, , "MCH_CASECO DE = #" &
Me!txtCCODE & "#"
the form I'm trying to open is "frmcases_union "
and im trying to filter it by the "MCH_CASECO DE" which i type into
txtCCODE.
When i click i get:
Run-time error 3705
Syntax error in date in query expression MCH_CASECODE = #1360#
is it because im using # signs which makes it think its a date?? what
should i use as placeholders?
Thanks, Gavin
Thanks guys, that worked. I was incorrectly using the # placeholder
for a number datatype This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Aravind |
last post by:
Hi folks.
I have 2 forms, frmMain and frmHistory.
frmHistory has a field called Return.
frmMain has a command button called "Due Today" (which will henceforth
be called as DT), which opens frmHistory and filters it to display
records where the value of Return is Null
|
by: Lyn |
last post by:
Hi,
I have a Search input form which collects from the user a person's name. I
am using LIKE with a "%" suffix in the SQL so that the user does not have to
type in the full name. When they hit the Search button, a query is run to
search the Person table for a match. This produces a recordset (I am using
ADO).
If the RecordCount is zero, they get a No Match message.
If the RecordCount is 1, a DoCmd.OpenForm is performed to open the...
|
by: Thelma Lubkin |
last post by:
formA determines some_where and some_value and issues
docmd.close ,Me
docmd.openform "formB", , ,some_where, , ,some_value
formB receives the correct some_where and some_value
After completing its work formB issues
docmd.close ,Me
docmd.openform "formA"
|
by: John Welch |
last post by:
I have a command button with the following code:
DoCmd.OpenForm "frmSearchAssignments", , , "SearchAssignmentID = 1"
(SearchAssignmentID is the PK, auto number)
When it runs, the form opens but shows all records, rather than going to the
one I want. If I look at the form in design view, it shows
'SearchAssignmentID=1' (without quotes) as the filter in the properties
list.
frmSearchAssignments is bound to a query qrySearchAssignments....
|
by: Mike |
last post by:
I am trying to open a search results form based on the input from a
prompt form. I am using the following code:
--- Begin Code ---
Private Sub btnSearch_Click()
'Dim Variable and assign data
Dim srce As String, fstnme As String, lstnme As String, bidnum As String
srce = Me.Source_Control
If Not IsNull(Me.Text18) Then
| |
by: rturpyn |
last post by:
I want to simply open a form, I don't want to limit the records
returned. I'm using the code....
DoCmd.OpenForm "frm_GSG_Access_Rights", acFormDS, ,
When I enter something in the where ("Elist_Caption = 'GSG Model'") it
does return my form with only 1 record. What am I missing?
Thanks,
-Turp
|
by: altesse33 |
last post by:
I am trying to open the form "frmClients_Main" to the record that is specified by the end user. Here is the code:
----------------------------------------------------------
Public Function IDSearch()
'This function allows the user to open the main form to a particular client record.
Dim stSql As String
Dim stInput As String
'InputBox prompts user to enter client ID for the form they wish to open.
|
by: silen |
last post by:
i am using Access2000. Currently i had a main form call "frmDownload" and sub form "fsubAdmmission". Under the fsubAdmmission, i do have another sub form "fsubHospital". Once i link my application to database A, when "frmDownload" loaded, it does successfully create "fsubAdmmission" object and i am able to assign "fsubAdmmission.form.recordsource".
Once i link my application to database B, when "frmDownload" loaded, it failed to assign...
|
by: erict |
last post by:
Access 2002-2003 runtime
App works fine on single proc machines but we are rolling out a tech refresh and we found this case where the code appears to simply slip through the open form command and the form never opens.
If Not IsNull(frmPODetails.Form!txtPONumber) Then
MsgBox "frmPurchaseOrders Open Form"
DoCmd.OpenForm "frmPODetailsUnbound"
End If
Note since this is a production issue Ihad to...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |