Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-18-2011, 09:57 AM   #1
sargturner
Newly Registered User
 
Join Date: Oct 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
sargturner is on a distinguished road
Unhappy Help With Save Button

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

sargturner is offline   Reply With Quote
Old 10-18-2011, 10:34 AM   #2
r.harrison
It'll be fine (I think!)
 
Join Date: Oct 2011
Posts: 134
Thanks: 1
Thanked 37 Times in 11 Posts
r.harrison is on a distinguished road
Re: Help With Save Button

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?
__________________
Why do people call me a geek? Not my fault I enjoy coding for fun!
r.harrison is offline   Reply With Quote
Old 10-18-2011, 12:01 PM   #3
sargturner
Newly Registered User
 
Join Date: Oct 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
sargturner is on a distinguished road
Re: Help With Save Button

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...

sargturner is offline   Reply With Quote
Old 10-19-2011, 12:48 AM   #4
r.harrison
It'll be fine (I think!)
 
Join Date: Oct 2011
Posts: 134
Thanks: 1
Thanked 37 Times in 11 Posts
r.harrison is on a distinguished road
Re: Help With Save Button

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.
__________________
Why do people call me a geek? Not my fault I enjoy coding for fun!
r.harrison is offline   Reply With Quote
Old 10-19-2011, 06:41 AM   #5
sargturner
Newly Registered User
 
Join Date: Oct 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
sargturner is on a distinguished road
Re: Help With Save Button

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 is offline   Reply With Quote
Old 10-20-2011, 07:05 AM   #6
sargturner
Newly Registered User
 
Join Date: Oct 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
sargturner is on a distinguished road
Re: Help With Save Button

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!

sargturner is offline   Reply With Quote
Reply

Tags
button , form , query , save , table

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question How i create a Save Button and A Clear Form Button? Amenofhis General 8 08-16-2012 09:51 AM
Only save record in subform when a save button is pressed patkeaveney Forms 3 02-05-2008 03:30 PM
Save button NewfieSarah General 7 11-02-2005 11:22 AM
Save Button versus Save safety net monkeytunes Modules & VBA 8 09-01-2004 12:17 PM
Combine custom save button on subform with save button on main form popeye Forms 2 08-27-2004 07:58 AM




All times are GMT -8. The time now is 09:21 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World