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 |
#11
|
|||
|
|||
Please help with Type Mismatch Error
sigh yes, the correct syntax for a number data type is
"MonthID = "& Me.ID but as i said before, the problem appears to be "a misplaced double quote and a missing ampersand." if you'll look carefully at the expression i posted, you'll see that i did not change the syntax for the MonthID. rather, i added an ampersand (&) and moved a double quote. compare my posted expression and your original posted expression and i'm sure you'll see the differences. as far as the "syntax error" goes, i made the assumption that you're using this expression in a VBA procedure. if instead you're using it directly in a form, report, or query, then the line-break character ( _ ) is not recognized. remove it, and put the entire expression all on one line. hth (and btw, "hth" stands for "hope this helps") Tina, Known to me as hth. Sorry I forgot my computer acronym book at work. Sigh How do you think I feel?? I have been messing around with this for the better part of a day. Your message states that you added an ampersand and moved a double quote. I think you added a double quote. My original formula was "MonthID = " & Me.ID You told me to try "MonthID = " & Me.ID & ". Three doulbe quotes?? I am telling you access gives me a syntax error. I am using this as a default value in the form but because of the unexpected fact that the statement is not working I am using VBA to troubleshoot. I hope you can help me with this problem if you read this. I'll send you a free trip to Tahiti or something. TVM (thanks very much) Sean |
#12
|
|||
|
|||
Please help with Type Mismatch Error
Post the exact line of code that is getting the syntax error.
TC (MVP Access) http://tc2.atspace.com |
#13
|
|||
|
|||
Please help with Type Mismatch Error
On 2 Apr 2006 21:22:56 -0700, TC wrote:
OT, but, I'm struggling to find a good newsreader. I like the way that google groups works, but they impose a posting limit, & they won't increase it for anyone. (I know; I've asked them; they've told me!) When I *eventually* (gasp) introduce myself on the mvp newsgroup, I'll be asking everyone else what they use. Cheers, TC (MVP Access) http://tc2.atspace.com TC I've been using Dialog for many years now for newsgroups (as well as e-mail). http://www.40tude.com/dialog/ -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#14
|
|||
|
|||
Please help with Type Mismatch Error
Your message states that you added an
ampersand and moved a double quote. I think you added a double quote. My original formula was "MonthID = " & Me.ID You told me to try "MonthID = " & Me.ID & ". Three doulbe quotes?? DLookup("CraftAH", "HoursTracking", "MonthID = " & Me.ID _ & "And CompanyID = 'SLM'") above is what i originally posted. not a third double quote - unless you take it out of context. however, i did find an error in the spacing. here's the correction: DLookup("CraftAH", "HoursTracking", "MonthID = " & Me.ID _ & " And CompanyID = 'SLM'") note the space between the double quote and the And, on the second line. my previous comments about removing the line break character and placing the entire expression on one line, if it's used directly in the form, still hold true. hth wrote in message oups.com... sigh yes, the correct syntax for a number data type is "MonthID = "& Me.ID but as i said before, the problem appears to be "a misplaced double quote and a missing ampersand." if you'll look carefully at the expression i posted, you'll see that i did not change the syntax for the MonthID. rather, i added an ampersand (&) and moved a double quote. compare my posted expression and your original posted expression and i'm sure you'll see the differences. as far as the "syntax error" goes, i made the assumption that you're using this expression in a VBA procedure. if instead you're using it directly in a form, report, or query, then the line-break character ( _ ) is not recognized. remove it, and put the entire expression all on one line. hth (and btw, "hth" stands for "hope this helps") Tina, Known to me as hth. Sorry I forgot my computer acronym book at work. Sigh How do you think I feel?? I have been messing around with this for the better part of a day. Your message states that you added an ampersand and moved a double quote. I think you added a double quote. My original formula was "MonthID = " & Me.ID You told me to try "MonthID = " & Me.ID & ". Three doulbe quotes?? I am telling you access gives me a syntax error. I am using this as a default value in the form but because of the unexpected fact that the statement is not working I am using VBA to troubleshoot. I hope you can help me with this problem if you read this. I'll send you a free trip to Tahiti or something. TVM (thanks very much) Sean |
#15
|
|||
|
|||
Please help with Type Mismatch Error
Post the exact line of code that is getting the syntax error.
TC, I just placed this in the on click event of a button to test the formula. This gives me a Syntax error: Me.Text97 = DLookup("[CraftAH]", "[HoursTracking]", "MID = " & Me.ID & " And "CompanyID = 'SLM'") This gives me a Type Mismatch Error: Me.Text97 = DLookup("[CraftAH]", "[HoursTracking]", "MID = " & Me.ID And "CompanyID = 'SLM'") Thanks, Sean |
#16
|
|||
|
|||
Please help with Type Mismatch Error
DLookup("CraftAH", "HoursTracking", "MonthID = " & Me.ID _
& "And CompanyID = 'SLM'") above is what i originally posted. not a third double quote - unless you take it out of context. however, i did find an error in the spacing. here's the correction: DLookup("CraftAH", "HoursTracking", "MonthID = " & Me.ID _ & " And CompanyID = 'SLM'") note the space between the double quote and the And, on the second line. my previous comments about removing the line break character and placing the entire expression on one line, if it's used directly in the form, still hold true. hth Tina AKA hth Thankyou so much for your help. I guess sometimes things need to be spelled out several times for me to understand. Where do you want me to send your free trip to Tahiti?? Thanks again. Sean |
#17
|
|||
|
|||
Please help with Type Mismatch Error
Thanks Fred, I will take a look at it. (I actually downloaded it some
time ago, but have not used it yet.) TC (MVP Access) http://tc2.atspace.com |
#19
|
|||
|
|||
Please help with Type Mismatch Error
Thanks TC. Along with Tina's help I am all straightened out now.
|
#20
|
|||
|
|||
Please help with Type Mismatch Error
well, we both muddled through it, glad it's working for you now.
wrote in message oups.com... DLookup("CraftAH", "HoursTracking", "MonthID = " & Me.ID _ & "And CompanyID = 'SLM'") above is what i originally posted. not a third double quote - unless you take it out of context. however, i did find an error in the spacing. here's the correction: DLookup("CraftAH", "HoursTracking", "MonthID = " & Me.ID _ & " And CompanyID = 'SLM'") note the space between the double quote and the And, on the second line. my previous comments about removing the line break character and placing the entire expression on one line, if it's used directly in the form, still hold true. hth Tina AKA hth Thankyou so much for your help. I guess sometimes things need to be spelled out several times for me to understand. Where do you want me to send your free trip to Tahiti?? Thanks again. Sean |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Runtime Error 13 - type mismatch | hindlehey | General Discussion | 1 | November 7th, 2005 02:51 PM |
Add New Field to DB | Karen | Database Design | 7 | October 19th, 2005 08:03 PM |
Access 2003 Table sort type mismatch error | Gregory Winters | General Discussion | 3 | August 19th, 2005 08:11 PM |
Data type mismatch in criteria expression error returned... | Rashar Sharro via AccessMonster.com | Running & Setting Up Queries | 3 | April 28th, 2005 08:49 PM |
data type mismatch error 3464 | dhawkins | Running & Setting Up Queries | 1 | April 20th, 2005 11:13 PM |