473,396 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Opening a filtered form on two different data type fields

I am trying to open a form based on the record set of the current form. The form I am opening should filtered based on a text field and a date field. The code I am using is as follows:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command100_Click()
  2. If Not Me.NewRecord Then
  3.     DoCmd.OpenForm "FrmPulls", , , "[TEXT]='" & Me!TEXT & "'" And "[DATE]=#" & Me!DATE & "#", , acWindowNormal
  4. End If
  5. End Sub
When I run the code I receive the error message "Run-time error '13': Type mismatch".

When I hover over the arguments in debug mode the data is correct. What is causing this error message??

Thanks
Feb 26 '08 #1
2 1268
Stewart Ross
2,545 Expert Mod 2GB
...When I run the code I receive the error message "Run-time error '13': Type mismatch".
HI Tadel714. It's the quote marks in your filter string which are causing the problem - the AND is not within the string at present:
Expand|Select|Wrap|Line Numbers
  1. "[TEXT]='" & Me!TEXT & "'" And "[DATE]=#" & Me!DATE & "#", , 
Change it to
Expand|Select|Wrap|Line Numbers
  1. "[TEXT]='" & Me!TEXT & "' And [DATE] = #" & Me!DATE & "#", , 
-Stewart
Feb 26 '08 #2
HI Tadel714. It's the quote marks in your filter string which are causing the problem - the AND is not within the string at present:
Expand|Select|Wrap|Line Numbers
  1. "[TEXT]='" & Me!TEXT & "'" And "[DATE]=#" & Me!DATE & "#", , 
Change it to
Expand|Select|Wrap|Line Numbers
  1. "[TEXT]='" & Me!TEXT & "' And [DATE] = #" & Me!DATE & "#", , 
-Stewart
That worked, thanks Stewart
Feb 27 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: origin197511 | last post by:
Hello all... I'm having an issue with MSAccess 2000. I have a Form that holds records of my cartridge loads for a rifle and a subform that lists all groups that have been fired with that load. ...
6
by: GSteven | last post by:
(as formerly posted to microsoft.public.access.forms with no result) I've created a continuous form which is based on a straightforward table (ex - customers - 100 records). On the form there is...
1
by: sparks | last post by:
I have a main table with teacher names and students I can put this in a subform and filter by teacher name so I have a list of her students in a sub form. the problem I have is this is created in...
3
by: melnhed | last post by:
---Report the current filtered records from a Form--- Hello All, I've seen this topic discussed before, but the solution described then doesn't work in my particular case. My Config: ...
16
by: radio1 | last post by:
---Report the current filtered records from a Form (in an ADP project)--- Hello All, I've seen this topic discussed before, but the solution described then doesn't work in my particular case. ...
17
NeoPa
by: NeoPa | last post by:
I rarely use forms to manage my data so I expect this is easier than I found it (I hate it when OPs say that :D) I have a simple table (laid out below) with lists of customers for various jobs...
2
by: atlbearcat | last post by:
Here's one that's been bugging me for about a week now... I have a form that allows users to filter records, simple enough. But I want to give them the option to export the filtered records to...
1
by: daverskully | last post by:
Table: Data Form: Entry Form Fields: 1) Department 2) DepartmentNumber 3) AccountExecutive 4) ReportDate 5) ID 6) 7 yes/no fields
1
by: geetamadhavi | last post by:
Hi All, I have developed a php applciaiton where a new window is opening on checking the whether valid user orntot how to make that in same window after checking i have die(' not valid user ' ); i...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.