Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with a report bounded to a query 1

Status
Not open for further replies.

0200050

Programmer
Jun 3, 2003
58
FI
Hi!

I have a form, where user types serienumbers. The form is continuous one. The form opens at the same time as a report. When a list of numbers are typed and a button pressed, the report will be runned. The report is bounded to a query. The numbers are typed into a textbox, called txtSer.

The query has following criteria in SerieNumber -field: Forms![NameOfMyForm]![txtSer]

The problem is this: When user types different serienumbers to a form, the report only receives the last typed number, and shows the record refering only to that number.

In this case I'd really like to take a look out of all those numbers, and their records, when report is opened.

Is this some kind of a bug in MS Access 2000 or is there something to do to make this work out?

Any suggestions and help would be really appreciated.

Thanks in advance,

Mike, finland


 
One way to accomplish this would be to create a "working" table of serial numbers. From your form, the user can populate the table with the desired numbers. Then you can use this table in a join in your report query to limit the report to the numbers entered by the user.
 
Hi mndrlion!

Yeah, I got that idea pretty fast, but my implementation sucks. I've done almost everything what you told there, I forgot to tell that the form was bounded to a whole new table. And when the form is closed table removes all information from itself.

At this point I can find one matter unsuccessful: the join from the table to the query. It doesn't work. I created one at the RelationShips, but it seems it doesn't provide the sought-after function.

I tried to do a subreport for a serienumberlist, and the main report shows all the information from the table. But when looking at subreport it only shows the information belonged to the first record. I would actually like to see the same information on the report at two times, but differently sorted. I bounded subreport and main report to the same query. It looks like that there cannot be a complete/successful report having two different views(sub/mainreport) bounded to the same query???


More suggestions are still appreciated.

Mike, finland
 
What you are trying to do will work.

But you need to slow down and take things one step at a time.

First - get the form working where the user can enter a list of desired numbers. This should populate your working table. You may want to create a new form bound just to this table. You should be able to add. change, and delete records in this table from your form.

After you have that working, you may want to add this new form as a sub-form to your existing form.


Then you can begin working on your report.
 
Let's simplify a bit.

This kind of a form.
Code:
---------------------|
name=MyTextBox       |
---------------------|
User inserts information to MyTextBox. MyTextBoxes are coming more if we press Enter. And then user wants probably to insert another number. He presses Enter. Another , still empty textbox appears below the first one.
Code:
---------------------|
                     |
---------------------|
Now user types some number to this too. Some figures. Like 1234567.

The view of the form is now here, as an example:
Code:
--------------------|
12345               |
--------------------|' First textbox
                     'Record 1

--------------------|
1234567             | 'Second textbox
--------------------| 'Record 2

---------------|
Command button |
---------------|'button, only hides the form

- Now user has typed two numbers, and is ready to press the Command button. Behind the command button there is simple code(Me.Visible = False). It hides the form, and report opens and query bounded to report runs.

Now, let's see the problem. We typed there two numbers.
Now we would like to see the records that has these two numbers as a part of them(one record has one of the numbers, and another record another number). But. When report opens up, it only displays the information about the LAST TYPED number. In the query bounded to report I set criteria [Forms]![MyFormName]![MyTextBox].


I'm a little out of direction right now at this. Any help will be highly valued.

Mike, finland

 
In the query bounded to report I set criteria [Forms]![MyFormName]![MyTextBox]

There is the problem. You are only referencing one text box from the report.

This will work much easier if you create a new table that can be populated with the desired numbers. This new table will be populated by the user from your form.
 
Wow, maybe I really should slow some down...

Speaking about the criteria, it should look like this:
[Forms]![MyFormName1]![MyTextBox1] And [Forms]![MyFormName1]![MyTextBox2]

But I anyway did this, and the problem stays on and on.

Hmm.. You suggest that I should create a new table? I have one table bounded to the form where user sets the values up. I created that afterwards. In that table there is only SerieNumber -field. It's totally empty. And if I'm getting that right, this is populating from that form. But what next?

Mike, finland
 
Now i created a table and a form which is bound to this fore-mentioned table.

I got the idea, yeah, but how in earth I could do a form, where I can write numbers down, and program would make a query and open refreshed report?

I'm totally out. If you know something about, please, provide your knowledge.

Regards

Mike
 
Thank you mndrlion! I chewed your messages a little longer than just a while, and now they opened to me too.

Now the whole thing is working out just fine, with an easy way.

Best greetings,

Mike, finland
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top