A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Type Mismatch



 
 
Thread Tools Display Modes
  #1  
Old September 29th, 2005, 08:55 PM
DS
external usenet poster
 
Posts: n/a
Default Type Mismatch


I'm trying to open a form based on a Query, which then goes to a record
but I keep getting type mismath
Thanks
DS


DoCmd.OpenForm "MenuItems", , "MenuItemsQQ", , , "[MenuCatId] = " &
Me![List44].Column(1) & ""

  #2  
Old September 29th, 2005, 09:20 PM
Klatuu
external usenet poster
 
Posts: n/a
Default

Assuming [MenuCatId] is numeric, there is a syntax error:
DoCmd.OpenForm "MenuItems", , "MenuItemsQQ", , , "[MenuCatId] = " &
Me![List44].Column(1) & ""
Should be:
DoCmd.OpenForm "MenuItems", , "MenuItemsQQ", , , "[MenuCatId] = " &
Me![List44].Column(1)

If it is text then it should be:
DoCmd.OpenForm "MenuItems", , "MenuItemsQQ", , , "[MenuCatId] = '" &
Me![List44].Column(1) & "'"

"DS" wrote:


I'm trying to open a form based on a Query, which then goes to a record
but I keep getting type mismath
Thanks
DS


DoCmd.OpenForm "MenuItems", , "MenuItemsQQ", , , "[MenuCatId] = " &
Me![List44].Column(1) & ""


  #3  
Old September 29th, 2005, 09:31 PM
Justin Hoffman
external usenet poster
 
Posts: n/a
Default

"DS" wrote in message
...

I'm trying to open a form based on a Query, which then goes to a record
but I keep getting type mismath
Thanks
DS


DoCmd.OpenForm "MenuItems", , "MenuItemsQQ", , , "[MenuCatId] = " &
Me![List44].Column(1) & ""


As I have just put in another post, you should make sure you have a valid
MenuCatID before you move on. Dimension a variable for this and try and
explicitly convert the value to the right type. For example, first make
sure it is not a null value, then convert it to a long, perhaps also make
sure it isn't zero then finally build up the string.


  #4  
Old September 29th, 2005, 09:35 PM
DS
external usenet poster
 
Posts: n/a
Default

Klatuu wrote:

Assuming [MenuCatId] is numeric, there is a syntax error:
DoCmd.OpenForm "MenuItems", , "MenuItemsQQ", , , "[MenuCatId] = " &
Me![List44].Column(1) & ""
Should be:
DoCmd.OpenForm "MenuItems", , "MenuItemsQQ", , , "[MenuCatId] = " &
Me![List44].Column(1)

If it is text then it should be:
DoCmd.OpenForm "MenuItems", , "MenuItemsQQ", , , "[MenuCatId] = '" &
Me![List44].Column(1) & "'"

"DS" wrote:


I'm trying to open a form based on a Query, which then goes to a record
but I keep getting type mismath
Thanks
DS


DoCmd.OpenForm "MenuItems", , "MenuItemsQQ", , , "[MenuCatId] = " &
Me![List44].Column(1) & ""


Problem solved. To many commas after MenuItemsQQ it should be one not
three.
Thanks
DS
 




Thread Tools
Display Modes

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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
type mismatch error importing from excel mary anne General Discussion 1 August 17th, 2005 04:25 AM
Data type mismatch in criteria expression error returned... Rashar Sharro via AccessMonster.com Running & Setting Up Queries 3 April 28th, 2005 08:49 PM
ByRef Type Mismatch inconsistent Bruce General Discussion 4 March 29th, 2005 08:43 PM
Data Type Mismatch when Opening Recordset Tom Rogers Setting Up & Running Reports 1 July 29th, 2004 12:25 PM
passing a value / type mismatch DanielS Using Forms 3 June 2nd, 2004 11:26 PM


All times are GMT +1. The time now is 08:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.