473,698 Members | 2,672 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Opening a filtered form on two different data type fields

2 New Member
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 1281
Stewart Ross
2,545 Recognized Expert Moderator Specialist
...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
TADEL714
2 New Member
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
4799
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. They are linked by the load_id field and when I just browse through the loads everything shows up correctly. Each recorded group is displayed on a line of the datasheet subform. However, when I filter the form for say my "Selected" flag...
6
9339
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 a checkbox with a control source named "MARK" (boolean) from customer table. I can check and uncheck individual records fine. Then I created 2 command buttons named "Select All" and "Deselect All". The Onclick property of these buttons runs code...
1
1590
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 tblmain but now I need to have them enter data each day for each student so I have a new table tbldata that has TimeStart, TimeEnd how can I make a list of students in a subform like I have now created from tblmain, and filtered(so far so...
3
3460
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: Access 2002 front-end using SQL Server 2000 (MSDE actually) via ADP/ADE Access Data Project.
16
3042
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. My Config: Access 2002 front-end using SQL Server 2000 (MSDE actually) via ADP/ADE Access Data Project. I have a form (containing about 80 fields) on which I allow the user to apply field/form filters -- this works fine.
17
3791
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 that have to be run. The PK is a combination of the first two fields ( & ) and I will typically want to maintain the various (logically separate) lists in different sessions (I may well use the same form design but only show one job at a time). For...
2
19309
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 Excel. I don't want to use the docmd.outputTo due to it won't filter the records, it puts all of the records in the file. I've looked around and found some code (actually that I'm already using), but the problem is that it outputs EVERYTHING on the...
1
1293
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
2005
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 even tried with echo also how to solve this the message should come under in the same window only see my code it is program ---- <?php // Connects to your Database mysql_connect('localhost', 'root', 'epara') or die(mysql_error());
0
8603
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8893
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7721
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4615
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2327
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1999
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.