473,320 Members | 1,724 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,320 software developers and data experts.

Values from forms into Reports

54
I have been asked to include a textbox on a form that allows the user to enter someone's NI number. They then want this value to automatically appear on a report. The only problem is the table is read only (as it is a Link table) so I cannot add a NI number field which means I cannot add it to the query used for the report. My question is, is it possible to get a value from a form (that is not in the table) and then put it into the report automatically? I have tried but keep getting the value #Name?

Help would be greatly appreciated! Thanks
Sep 15 '09 #1

✓ answered by NeoPa

@g diddy
Expand|Select|Wrap|Line Numbers
  1. 'Some code to set up a string (strWhere) just like the
  2. 'WHERE clause of a SELECT query but missing the word WHERE.
  3. Call DoCmd.OpenReport(ReportName:="YourReport", _
  4.                       View:=acViewPreview, _
  5.                       WhereCondition:=strWhere)
I've used named parameters to make what it's doing clearer.
@g diddy
This doesn't say what form you expect (the operator) to use when specifying multiple items. Without this it's impossible to formulate the logic or the code.

You may want to consider a Multi-Select ListBox control for this. Would that work for you?
@g diddy
Oh yes. Data is not stored with the design of the form.

7 1312
NeoPa
32,556 Expert Mod 16PB
If you simply wish to pass a single value to a report at run time then you can use the OpenArgs parameter of the DoCmd.OpenReport function.
Sep 15 '09 #2
g diddy
54
what should I do if the report shows multiple records? The user would not want to have to type in values again for each individual record when the report was opened. Also I tried typing a value into the field on the form but it did not save when I closed it (as the field does not save to a table) so I think, because I cannot edit the original table to add the field (and therefore the query used for the report) I don't think it may be possible to do so like this. Unless there is some way of storing information on a form (for each individual record) without it having to be stored in a table? If I can work that out I'l be half way there!!
Sep 16 '09 #3
NeoPa
32,556 Expert Mod 16PB
This is normally handled by filtering at the point of opening the report.

I think you need to give some consideration first to how you expect the operator to specify which NI Nos he requires to report on. How the thing will work will depend heavily on what form that data is in.
Sep 16 '09 #4
g diddy
54
How do you filter at the point of opening a report? Basically I want to be able to type into a text box (that is not linked to a table) for 1+ records then save the form. I tried typing in some data into the text box, saved the form then closed it but when I opened it the text box was blank. Do you have to have the field in a table to be able to save it on a form?
Sep 16 '09 #5
NeoPa
32,556 Expert Mod 16PB
@g diddy
Expand|Select|Wrap|Line Numbers
  1. 'Some code to set up a string (strWhere) just like the
  2. 'WHERE clause of a SELECT query but missing the word WHERE.
  3. Call DoCmd.OpenReport(ReportName:="YourReport", _
  4.                       View:=acViewPreview, _
  5.                       WhereCondition:=strWhere)
I've used named parameters to make what it's doing clearer.
@g diddy
This doesn't say what form you expect (the operator) to use when specifying multiple items. Without this it's impossible to formulate the logic or the code.

You may want to consider a Multi-Select ListBox control for this. Would that work for you?
@g diddy
Oh yes. Data is not stored with the design of the form.
Sep 16 '09 #6
g diddy
54
thanks for all your help and advice
Sep 17 '09 #7
NeoPa
32,556 Expert Mod 16PB
A pleasure. I hope it helped you along :)
Sep 17 '09 #8

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

Similar topics

1
by: Richard Golebiowski | last post by:
I have been trying to figure this out for quite some time and cannot find any examples in VB.Net or in VB that work correctly. I am working on an application where I want the user to be able to...
1
by: SJH | last post by:
I have been given an older database and asked to make upgrades and what not. One interesting thing I have come across with the database is that it was at one time set up so one of the tables would...
2
by: Timppa | last post by:
Hi, I have Access 2000 and now I'm converting .mdb database to .adp and Sql Server 2000. In old .mdb application I have a query which handles msysobjects table (reading forms and reports...
1
by: Nicolae Fieraru | last post by:
Hi All, I am working on an Access 2000 project where it was necessary to rename some fields in a table or to delete some fields and to recreate new ones. Now there are many forms and reports...
1
by: Nicolae Fieraru | last post by:
Hi All, I want to find if there is a different way than the way I am working now. Lets say I have a table, tblCustomers containing address details. I want a report with all the customers from...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
1
by: Eskil | last post by:
Hi I have a form that supplies my query with information on two different variables. The form uses a lookup to display a list of 5 different customer types and 5 different types of...
2
by: misscrf | last post by:
I have a search form that is great. I have modified it in such a way, that when search results come up I can bring it back to a useful spot, say an entry form or a report. Here is my lemon (...
3
by: Nick Douglas | last post by:
I have an unbound form to generate reports from in an mdb that we share on our network drive. The users selects several options for the report, such as what to view, the sort order, etc. These...
13
by: BLKeller | last post by:
I'm having a problem with a site I'm working on which contains links to Reporting Services reports. The pages are written in HTML and classic ASP. The links to the reports are in the following...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.