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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
"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
|
|||
|
|||
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 | |
|
|
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 |