Help With Save Button (1 Viewer)

sargturner

New member
Local time
Today, 18:21
Joined
Oct 18, 2011
Messages
7
Hello,
I am designing a database to keep track of people's van driving training. I have a form to add a new member to a selected class. This is supposed to save to a query where I can then see who needs to update their training and who does not. On my form I have...

Last name (text box)
First name (text box)
Date (of the course, dropdown)
Instructor (of the course, dropdown)
Location (of the course, dropdown)

I want to add the member to my table and save all of the data in a query. I created a button and embedded a macro within it to save and close the form. It works great but it is also saving the instructor and location and adding them as if they are new records to be recorded. I only want to save these in the query, not in their tables.

Please any help would be great! This is the last part of my project I need to do then it is done and its been driving me insane! Also I am not a super VBA genius.. I know the basics of it hence why I am using a macro instead of writing the code. If writing the code would be easier (im sure it would be) please give a brief explanation of it.

Thanks,
Ryan Turner
 

r.harrison

It'll be fine (I think!)
Local time
Today, 22:21
Joined
Oct 4, 2011
Messages
134
Hi,

I'm not overly sure what it is you're trying to do. But a Query does not store data. The query simply looks up the information from a table.

To be able to see the info in the query it would have to be saved to the table?
 

sargturner

New member
Local time
Today, 18:21
Joined
Oct 18, 2011
Messages
7
Yes I understand, but I do not want to have duplicates of the instructors and locations in their tables. I want to save them in a link table. But when I hit save it saves them in their tables as well so for instance..

Last Name: Turner
First name: Ryan
Date: 10/18/2011
Location: Room 101
Instructor: Bob

I want it to save only the ID of the member the ID of the date, ID of the location and ID of the instructor in a link table. I don't want to add another Bob in the instructor table. Maybe im just trying to go about this the wrong way but seeing how its the last thing left in my project I really don't want to have to redo anything...
 

r.harrison

It'll be fine (I think!)
Local time
Today, 22:21
Joined
Oct 4, 2011
Messages
134
Hi,

If it's only ID's you need to store then set the First name, surname fields as they are, then set the rest as Lookup fields.
 

sargturner

New member
Local time
Today, 18:21
Joined
Oct 18, 2011
Messages
7
Hi,

I'm not sure if I just did it wrong or not but all I want to do is make it so my save button only creates a new name not a new location, instructor...

Maybe I could have my instructor and location autofill depending on the date... any idea how to do that?
 

sargturner

New member
Local time
Today, 18:21
Joined
Oct 18, 2011
Messages
7
Ok so I thought of a way to maybe clarify what I want to do...

My form is created based off from my Link Query to compile all of the data for a report print out

In my form I want to be able to enter first name last name.
This part works fine...

Then I need to recall a date for a class...
Works fine (doesn't create another date that I already have) This is based off from another query that compiles only the class information...

I want to also recall the location and the instructor...
I have the drop downs linked to their appropriate tables... and i understand that when I go to save it is saving these values in those tables. I would pull the info for these from my class query but then it shows duplicate records unlike my dates...

I tried entering the info as a value list and I tried making lookup fields in my tables like you said but it saved the instructor/location as an ID number instead of by the actual name.

Thanks for all the help!
 

Users who are viewing this thread

Top Bottom