473,327 Members | 2,118 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,327 software developers and data experts.

Names and Dates

I have a combo box with several names, once a name is selected then it
goes and gets a report of the name of the person that has been
selected.

I would like to put this and date selection on one form, the query
won't run, it says that there is too many parameters.

so select name then select dates that you would like to pull up and
then put this into a report.

Any help would be greatly apprectiated... as no idea where to turn on
this one.

Elaine
Jan 9 '08 #1
1 1324
Elainie wrote:
I have a combo box with several names, once a name is selected then it
goes and gets a report of the name of the person that has been
selected.

I would like to put this and date selection on one form, the query
won't run, it says that there is too many parameters.

so select name then select dates that you would like to pull up and
then put this into a report.

Any help would be greatly apprectiated... as no idea where to turn on
this one.

Elaine
Assuming the combo is called ComboName and the dates are FromDate and
ToDate and the date field in the table is DateFld, your code make look
something like
Docmd.OpenReport Me.ComboName,,,_
"DateFld Between #" & Me.FromDate & "# And #" Me.ToDate & "#"
This assumes both dates are filled in.

Do you create a separate report for each person's name or did you want
to filter the report on the persons name? Let's pretend you wanted to
filter on a person's name and date range. Your code may be similar to
the following (dates surrounded by #, strings by ' or "")

Dim strFilter as string
If Not IsNull(Me.ComboName) Then
strFilter = "TableNameFld = '" & Me.ComboName & "' And "
Endif
If Not IsNull(Me.FromDate) Then
strFilter = strFilter & "DateFld >= #" & Me.FromDate & "# And "
Endif
If Not IsNull(Me.ToDate) Then
strFilter = strFilter & "DateFld >= #" & Me.ToDate & "# And "
Endif

'if there is a filter, remove the trailing 'And'
If strFilter "" Then strFilter = Left(strFilter,Len(strFilter)-5)
Docmd.OpenReport YourReportName,,,strFilter
Jan 9 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: dan | last post by:
I have a script that selects a value in an option in a selection list according to how many letters were entered in an input box. I have it working but I am limited to what I can name the form...
12
by: Steve Darby | last post by:
Hi there, How can I use a regular expression to check that a name in a form field begins with a capital letter?
0
by: zacks | last post by:
I am trying to use the Microsoft Text Driver to access data in a text file via ODBC calls. Everything has worked fine so far. I am now trying to implement support for a file that has a special...
2
by: Arnold | last post by:
Greetings Gurus, In a report showing the names of students and their progress, I am getting an error in the name field (Name: #Error). The report gets its data from an unbound form containing...
12
by: Dixie | last post by:
I am trying to calculate the number of workdays between two dates with regards to holidays as well. I have used Arvin Meyer's code on the Access Web, but as I am in Australia and my date format is...
2
by: xeshu | last post by:
HelowWw fellow programmers :) I have a web application that opens a pdf file. Very simple indeed. However the file name is not known. The file has to be found by first searching the list of all...
13
by: Mark | last post by:
Dear folks, In Javascript, is it possible to get all id names within, say, a <div></divpair? Like the array of "document.images", I mean. The reason I ask, is that I have a calender whose...
5
by: moddster | last post by:
Hi Guys. I am a newbie to perl and need some help with a problem. PROBLEM: I have to parse an HTML file and get rid of all the HTML tags and count the number of sumbissions a person has through...
14
Boxcar74
by: Boxcar74 | last post by:
Ok I don’t know if this is possible. I Know SQL Ok and it’s been a while since I worked with VB. But what I’m trying to do is query by the dates in the column names. For instance I'm tracking...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.