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

Can't get Report to show data from records based on a Form's Combo Box choice.

I am completely new to access programming let alone VB. But I got pretty far with some help from the main programmer.. However I'm trying to introduce a new feature to the database which is basically this:

1) Make selection of "Symptom" from the "Patient" table via Combo box on the form.

2) Click a button on the form to open the report "Patient PD Report" showing details of all recorded patients with that "Symptom"

AND THE CODE I USED IS:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "Patient PD Report", acViewPreview, , "[Symptom] = '" & Me.PD & "'"


Yet for some reason after making a selection and clicking the button to execute the code, I keep getting a blank report. Can I add any details to make my predicament clearer?? Please help me! The deadline for demonstration is not far away :P!
Dec 29 '10 #1
4 1578
ADezii
8,834 Expert 8TB
What is the Record Source for the Report?
Dec 30 '10 #2
Nevermind ADezii, lol I found out what the issue was. I got the function working properly thru a minor change (Conceptual :P!) See I had used the code:
Expand|Select|Wrap|Line Numbers
  1. SELECT [Patient.RN], [Patient].[Symptom] FROM [Patient] ORDER BY [Patient].[RN]

To make the combo box "PD" show a list of values from the field "Symptom" in the table "Patient". And I'm guessing the reason why the code in the OP didn't work is because "Symptom" wasn't the linked field via Relationships in the database, and I don't think it should be because the data type isn't unique for every record.. Right? (YES! Total NOOBness..!).

So I simply had to change the OP code to:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "Patient PD Report", acViewPreview, , "[RN] = '" & Me.PD & "'"

Thnaks for replying anyways, I have literally tons of other things I'm hoping to be able to do with this awesome software, who knows where I might go. This almost feels like a new addiction waiting to happen :)!

If any1 is willing to help me out here (PLZ!), I have a few ideas I need to figure out how to actually do:

1) Make Form text/background colour change once a check-box on the form is selected. Then make a 'Save' or 'Confirm Changes' button which will do exactly that and then lock the Form from any further editing. Maybe even to be unlocked with a password if needed.

2) Make a Report with just one box showing ALL the values recorded under a field. AS in not separated into consecutive rows/columns by each record, but rather displayed like the words in this post. With each field entry displayed from every record separated by just a comma.

3) Actually learn how/when/where to successfully use the "Lookup" command. And eventually build my 1st Filter/Search functions & searchable forms.

I could go on.. lol :P! And yes, I'll look up any useful links. Please help a newbie programmer out. Thanks!
Dec 30 '10 #3
My friend, you are talking too much!
Be straight to the point, brief as much as possible and includes all details of what exactly you are looking 4!
You may not get enough reponse otherwise
Dec 31 '10 #4
I am SO sorry for not posting a concise message. Basically I have managed to get the issue solved myself. I kind of forgot the nature of this website, I've never actually participated in forums of this nature or programming for that matter lol, took it as one of those threads at IMDb etc hehe. I should have started separate threads for separate questions for Access. Thanks for replying & pointing this out Moah Scout lol :P!
Jan 5 '11 #5

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

Similar topics

2
by: Sean | last post by:
Greetings all, I am attempting to make a form that will filter through several tables that (I believe) have refretial integrity. I am pulling data from several tables into the form and i would...
1
by: arthur-e | last post by:
How can you select records based on more than one combo box - I have a combobox that selects records based on name (I'm sure this has been asked a thousand times - web site answer/link could be...
1
by: meganrobertson22 | last post by:
hi everybody- what is the best way to add data from one form to another? i have 2 tables: person and contract. here are some of the fields. table: person personid (autonumber and primary...
4
by: MLH | last post by:
I have a combo box control on a form and a text box beside it in which I would like to display the number of listings in the combo-box. The combo box lists more or fewer rows depending on the...
3
by: panwala_bhavesh | last post by:
I have a form (View All Assets) with two combo boxes (ComboManufacturer & ComboProductType) and a subform with a dataview that displays the results of my query below: SELECT Assets., Assets....
6
by: Kazza | last post by:
Hi I'm using Access 2003 and I need to figure out how to display the record details based on a combo box selection. For example, when I select a company name in a combo box, how do I get the related...
0
by: Josetta | last post by:
This is for informational purposes...I had a problem and I thought it might help others in a similar situation. I hope someone, someday, finds this idea useful. I've garnered so much knowledge...
2
by: kennygee | last post by:
I am trying to learn VB after many years programming in Access. I am trying to do something in VB that is simple in Access. How do I display record data on a form based on the selection made in a...
1
by: ochalove26 | last post by:
hi all, i'm a new programmer... i use a combo box to filtering the records in my sub form..it was works...but when i want to show all records in my sub form it doesnt works..how it would be?please...
6
by: BEETHOVEN | last post by:
I have an option group called Issue_Type on my main form F1_Member_Demographics_Main. When I select one of the 3 options on the main form from the option group Issue_Type I want to limit the sub...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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,...

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.