Go Back   Access World Forums > Access World > Site Suggestions

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-11-2018, 11:51 AM   #1
kobiashi
Newly Registered User
 
Join Date: May 2018
Posts: 47
Thanks: 10
Thanked 0 Times in 0 Posts
kobiashi is on a distinguished road
form is saving id not name

I have created a form to create new users, when you press save, it works, save all the details in the query, however i have created a couple of combo boxes, and set them like

bound column 1
column count 2
column width 0";1"


but when i view the query, the form has saved the id and not the name fro the combo boxes, i cant seem to find whats the issue

kobiashi is offline   Reply With Quote
Old 05-11-2018, 11:57 AM   #2
ridders
AWF VIP
Gold Supporter
 
ridders's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 4,914
Thanks: 75
Thanked 1,216 Times in 1,133 Posts
ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough
Re: form is saving id not name

If the name is in the second column, you need to reference that.
As column numbers are zero based use me.comboboxname.Column(1).

However, you can't do that in a query so use a variable such as strName to grab the value, then use the variable or a function based on that in your query.
__________________
Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left and leave a comment.

New example databases:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
ridders is offline   Reply With Quote
The Following User Says Thank You to ridders For This Useful Post:
kobiashi (05-11-2018)
Old 05-11-2018, 12:02 PM   #3
June7
Newly Registered User
 
Join Date: Mar 2014
Posts: 238
Thanks: 0
Thanked 54 Times in 54 Posts
June7 is on a distinguished road
Re: form is saving id not name

Why would you not save the ID? Isn't it the primary key? If you don't want to save ID then don't include it in the comobobox RowSource.

Why are you running a query to save record? Is form not bound to table?

June7 is offline   Reply With Quote
Old 05-12-2018, 12:34 AM   #4
Gasman
Access newbie
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 1,872
Thanks: 242
Thanked 263 Times in 248 Posts
Gasman will become famous soon enough Gasman will become famous soon enough
Re: form is saving id not name

I believe that is how it is meant to work. You save the key not the description.
You then use that key to get the description back.

That way, if you change the description, you do not have to change any links between tables?

At least that is how I have always done it.
I *always* make the first field the ID/key field, and then have my other columns after that, some of which might not be displayed as well.

HTH

Quote:
Originally Posted by kobiashi View Post
I have created a form to create new users, when you press save, it works, save all the details in the query, however i have created a couple of combo boxes, and set them like

bound column 1
column count 2
column width 0";1"


but when i view the query, the form has saved the id and not the name fro the combo boxes, i cant seem to find whats the issue

__________________
Access novice. Sometimes trying to give something back.
Access 2007
Gasman is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving a Form Keefay78 Forms 2 08-04-2017 01:22 PM
Record Saving Issue regarding Main Form and Sub Form phool4fool Forms 5 12-26-2011 10:35 PM
Close form without saving (form loads dirty) tt1611 Forms 4 06-08-2010 03:24 AM
Keep form from saving wtrimble General 11 03-10-2010 01:41 PM
Form help - disable close form from saving changes/updates to table PRodgers4284 Forms 3 02-26-2009 05:32 AM




All times are GMT -8. The time now is 11:54 PM.


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

Sponsored Links

How to advertise

Media Kit


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