Check box to select output fields

If its due in two days, go back to what you had working and worry about getting it right AFTER you get the grade. How long until you get graded on the end result?
 
I have about a month till the final project is due. However i still do not have the check box going...
 
Can you create a new DB, copy over the form and the table driving it, and post it here with notes of what you've tried?
 
First i will thank you for your patience.

Here it is. What ive done is added the two tables which i am attempting to use and created a query which brings them together. Then i created a form with a sub form which is a datasheet of the query. It is after this i get lost...let me know if you require anymore information.
 

Attachments

OK, the reason you've been having errors is you never added checkbox controls to your form.

Step 1) Add check box controls to your FORM (Not subform) Just like Arnel did in his sample. This is done by opening the form in design view, clicking on "Design" at the top, selecting the check box control then clicking on your form where you wish it to be.

Step 2) Open the properties for the control box. Give it a name that makes sense for what you are doing.

step 3) Look at the sample Arnel posted. See which even he is using for each control then use the same type of code. You will have to replace the control name he's using with the ones you provided in Step 2).

Were I in your position, I'd start by adding ONE checkbox control, make sure you do it properly, rename it, then get the code for that check box to work. Once you've figured that part out, you should be able to do the same with the rest.

Just so you understand, the way you have your query set up you will not be able to edit data on the subform.

You also do not have the same definition for your two files. In one, Code is a number. For the other Code is a short text. If you are trying to simply view both together this would prevent you from doing a UNION query.
 
OK, a few other issues you would have with how you are setting up your query.

As it is adding everything from both files, you will get redundant data. I'm uploading a modified version to show the difference between what you were trying and what you would get with a normal UNION of queries. I'm hard coding in the Sysco/GFS and bakedgoods as expressions in the source queries for the union. Still not editable, but will only show a given record once. I also put them into a form set to datasheet.

The sample data shows the issue you were having.

If you want to hide/unhide fields, change sort, do filtering and the such, the built in Access abilities may meet your needs. Just open F_All and right click on the header for any field. That will tell you what you can/can't do in that field. This does include hiding/unhiding columns, much like what you are trying to do.

After you get past this part of the project we can talk about how you get your data into the same structure the Union query uses. This is one of the reasons you put it all into one table rather than having separate tables the way you have it.
 

Attachments

Thanks for the info Mark. I quick hiccup I have encountered when trying to follow your steps is that when i open the VBA screen (ALT F11) there is nowhere to type my code. Do you know what my issue here could be? attached is a screenshot.
 
Sorry, once again with the screenshot
 

Attachments

  • Screenshot 2018-02-20 06.07.33.jpg
    Screenshot 2018-02-20 06.07.33.jpg
    94.8 KB · Views: 121
Should be the same place you put it before? You already have a form that was giving you errors with Me. so I figured you already had the spot you were going to put the code. You would use the same events as Arnel. You have been looking at how he did it, correct? Have you been looking through the events also?
 
Thinking it through, did you open the sample I posted? Did you look at the form I added based off of the union query? Just want to see if that will do what you need.
 
Hi Mark,

So I went with the Hide/Unhide fields functionality that access provides. Not exactly what i want but it will work just fine in this case. I am currently getting all of the selected quotes into one table and then I will be making a form which will be used to create menu items. Im sure i will run into some difficulties there. Thank you so much for all the help and patience!
 

Users who are viewing this thread

Back
Top Bottom