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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button in form to open report and insert selected fields

Status
Not open for further replies.

chaos18

IS-IT--Management
Dec 31, 2002
32
US
I guess i should start at the beginning. I have table with my information(obviously), and i have a startup form which is automatically activated when access opens my database. The for has several buttons, but the one of importance is the "find now" button. It opens another form; that form opens a query in a form view so it looks pretty. what i want now is a button that would look at my "yes/no" field in the form and if the record is equal to "yes" then i want it to take that selected record (or however many) and insert it into a report. I've tried a few things, mostly If,Then phrases to complete what i want, and to a degree i have been successfull, but i still get the records that do not have yes answers...any ideas?


-Thomas Gunter-
 
Do it differently. What you're doing is this:

1. You have a continuous form which lists data for a bunch of items.
2. There is a checkbox next to each item, for which you select "yes" or leave it as no.
3. You want to open a report which has all the items tagged "yes".


Do this using a listbox and command buttons. Every time someone clicks on the button to the left of the item, it will add that item to the listbox. When you decide to run the report, the WHERE clause is generated using all the items in the listbox. (specifically the "IN" keyword in SQL may become useful)



The problem with your checkboxes is that Access isn't good about storing form information that isn't bound to a table. If you bound the checkbox to a field in the table, then Access would handle it perfectly--of course, this could create more problems than it would solve, so I urge you not to do this.

--
Find common answers using Google Groups:

Corrupt MDBs FAQ
 
thanks...i'll see what this does and let you know

-Thomas Gunter-
 
ok...ive been trying to get that to work and i havent been able too...any ideas on how i should write this

-Thomas Gunter-
 
Hi,

- Add a yes/no combo box to your form and name it cmbYesNo.

- Open your query in design view and add the following to the criteria for your yes/no field:

[Forms]![nameofyourform]![cmbYesNo]

This will post the yes/no combo box value from your form to the query and display only the value that was selected in the combo box.

Hope this helps..
 
my apologies for being so dense but i still cannot get the combo box and yes\no field to work. it either goes all or nothing and its rather frusterating. if i select yes in ANY of the yes\no fields then all of the items in my entire list is put in the combo box...and if i dont select any, there will be none...so i doonno...any advice

-Thomas Gunter-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top