Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 20th, 2004, 08:25 PM
Rishyraj Rishyraj is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 53 Rishyraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 29 m
Reputation Power: 14
Syntax error in date in query expression

Syntax error in date in query expression '[Director's meeting day] = #3#

can any one please explain this error.

thank you

Reply With Quote
  #2  
Old November 20th, 2004, 09:30 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 14
Rishy,

The # is used to tell Access you are using a date/time variable. What is the 3 in your syntax suppose to be.

lwells

Reply With Quote
  #3  
Old November 20th, 2004, 09:55 PM
Rishyraj Rishyraj is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 53 Rishyraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 29 m
Reputation Power: 14
Smile #3# is what the error message is displaying

Iwells,

I have not typed the #3#. It is the part of the error message and sometime it is displayed as #1#(in the error message)

Please advise





Quote:
Originally Posted by lwells
Rishy,

The # is used to tell Access you are using a date/time variable. What is the 3 in your syntax suppose to be.

lwells

Reply With Quote
  #4  
Old November 20th, 2004, 10:24 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 14
Hi Rishy,

Can you post the sql of your query and let me look at it.

lwells

Reply With Quote
  #5  
Old November 20th, 2004, 10:36 PM
Rishyraj Rishyraj is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 53 Rishyraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 29 m
Reputation Power: 14
Sql

Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Directors Meeting Day Form"

stLinkCriteria = "[DirectorsMeetingDay]=" & "#" & Me![Combo0] & "#"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click

End Sub














Quote:
Originally Posted by lwells
Hi Rishy,

Can you post the sql of your query and let me look at it.

lwells

Reply With Quote
  #6  
Old November 20th, 2004, 10:39 PM
Rishyraj Rishyraj is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 53 Rishyraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 29 m
Reputation Power: 14
Unhappy Sql

Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Directors Meeting Day Form"

stLinkCriteria = "[DirectorsMeetingDay]=" & "#" & Me![Combo0] & "#"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click

End Sub


Iwells, is there any way i can learn ms access/sql/vb...my job requires all this ..if not advance level atleast basic level... i come home frustrated everyday...can you please help... or suggest how to cope with this...

Rishy














Quote:
Originally Posted by lwells
Hi Rishy,

Can you post the sql of your query and let me look at it.

lwells

Reply With Quote
  #7  
Old November 20th, 2004, 11:00 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 14
Hi Rishy,

On the first part, if your [DirectorsMeetingDay] is in a date/time format, then we need to take a look at the combobox for a couple of things.

1) In the combobox is the format for the column a Date/Time format.
2) If the above answer is yes, is this column the bound column for your combobox.

In order for your command button to work properly, both the [DirectorsMeetingDay] and the [Combo0] must have the same Date/Time format.

From the error message posted previously, it looks like the bound column maybe the index number of the row rather than the column containing your date/time field.

A good book to start with, is by the publisher WROX titled Beginning Access 2000 VBA. It is a little outdated but will have alot of good basic and some intermediate vba code for you to learn and understand. It comes with a tutorial cd so you can use the practices with a database that's on the cd. I would recommend it to get started with.

lwells

Reply With Quote
  #8  
Old November 21st, 2004, 10:19 PM
Rishyraj Rishyraj is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 53 Rishyraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 29 m
Reputation Power: 14
Smile Default value.

Iwells,

The suggestion which you gave for the dafault value is working in one case and not in the other. I do not know the reason.

Private Sub Comments___Conditions_Change()

Commentsdirectors.Value = commentsconditions.Text

End Sub
Private Sub LoanAmount_Change()

Loanamtdirectors.Value = LoanAmount.Text
End Sub


This is what is am writng as a code. It gives me a error as "run time error 424" object required. The second one works not the first one.

Can you please advise.

Thank you

Rishy








Quote:
Originally Posted by lwells
Hi Rishy,

On the first part, if your [DirectorsMeetingDay] is in a date/time format, then we need to take a look at the combobox for a couple of things.

1) In the combobox is the format for the column a Date/Time format.
2) If the above answer is yes, is this column the bound column for your combobox.

In order for your command button to work properly, both the [DirectorsMeetingDay] and the [Combo0] must have the same Date/Time format.

From the error message posted previously, it looks like the bound column maybe the index number of the row rather than the column containing your date/time field.

A good book to start with, is by the publisher WROX titled Beginning Access 2000 VBA. It is a little outdated but will have alot of good basic and some intermediate vba code for you to learn and understand. It comes with a tutorial cd so you can use the practices with a database that's on the cd. I would recommend it to get started with.

lwells

Reply With Quote
  #9  
Old June 22nd, 2016, 02:32 AM
dawn12789 dawn12789 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2016
Location: pHILIPPINES
Posts: 1 dawn12789 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 9 sec
Reputation Power: 0
Can anyone help me with my codes:

report("SELECT * FROM DTR_REC WHERE SDATE ='#" & txtfrom.Text & "'#", "CrystalReport1")


SDATE is my field in database and its datatype is datetime

When i type 4/26/2011 in a textbox
I encountered error in vb saying "Syntax error in date in query expression 'SDATE ='#4/26/2011'#'.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Syntax error in date in query expression


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap