dbTalk Databases Forums  

ControlSource and saving to table

comp.database.ms-access comp.database.ms-access


Discuss ControlSource and saving to table in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Otie
 
Posts: n/a

Default ControlSource and saving to table - 04-02-2005 , 10:52 PM






Is there a simple answer as to why my database will not save the data
that correctly appears in the AccountID textbox on a form to the table
when I set the AccountID.ControlSource =
DLookUp("[AccountID]","Expense accounts","[ExpenseAccountName] =" &
"'" & [Forms]![Expenses]![ExpenseAccountName] & "'")?

The number in the textbox is correct (it finds the proper index - id -
when I select the ExpenseAccountName). But when I save the record and
then look at the information in the Expenses table, the AccountID
information is incorrect - it has not changed when I change the
ExpenseAccountName data.

This is MOST frustrating and strange.

Thank you.


--


---
Allen



Reply With Quote
  #2  
Old   
Ira Solomon
 
Posts: n/a

Default Re: ControlSource and saving to table - 04-03-2005 , 12:41 PM






Hi Otie:
Luckily the answer is simple.

You have not connected the account ID to the form.
The field on the form is connected to the lookup, which is just
floating there.

The form should have your table as the record source.
Create the ExpenseAccountName combo box with the combo box wizard.
One of the options in the wizard is to find a record.
The set the control source for the accountID text box to accountID.
Now when you select a name from the drop down box , the account ID
text box will automatically populate with the current number.
If you change the number and then click in another box the new number
will be saved.

Good luck

Ira Solomon

On Sat, 2 Apr 2005 19:52:55 -0800, "Otie" <otie_nospam (AT) adelphia (DOT) net>
wrote:

Quote:
Is there a simple answer as to why my database will not save the data
that correctly appears in the AccountID textbox on a form to the table
when I set the AccountID.ControlSource =
DLookUp("[AccountID]","Expense accounts","[ExpenseAccountName] =" &
"'" & [Forms]![Expenses]![ExpenseAccountName] & "'")?

The number in the textbox is correct (it finds the proper index - id -
when I select the ExpenseAccountName). But when I save the record and
then look at the information in the Expenses table, the AccountID
information is incorrect - it has not changed when I change the
ExpenseAccountName data.

This is MOST frustrating and strange.

Thank you.


Reply With Quote
  #3  
Old   
Otie
 
Posts: n/a

Default Re: ControlSource and saving to table - 04-03-2005 , 02:33 PM



Thank you so much!


--


---
Allen

Free astrology software at:
http://www.astrowin.org

"Ira Solomon" <isolomon (AT) solomonltd (DOT) com> wrote

Quote:
Hi Otie:
Luckily the answer is simple.

You have not connected the account ID to the form.
The field on the form is connected to the lookup, which is just
floating there.

The form should have your table as the record source.
Create the ExpenseAccountName combo box with the combo box wizard.
One of the options in the wizard is to find a record.
The set the control source for the accountID text box to accountID.
Now when you select a name from the drop down box , the account ID
text box will automatically populate with the current number.
If you change the number and then click in another box the new
number
will be saved.

Good luck

Ira Solomon

On Sat, 2 Apr 2005 19:52:55 -0800, "Otie" <otie_nospam (AT) adelphia (DOT) net
wrote:

Is there a simple answer as to why my database will not save the
data
that correctly appears in the AccountID textbox on a form to the
table
when I set the AccountID.ControlSource =
DLookUp("[AccountID]","Expense accounts","[ExpenseAccountName] =" &
"'" & [Forms]![Expenses]![ExpenseAccountName] & "'")?

The number in the textbox is correct (it finds the proper index -
id -
when I select the ExpenseAccountName). But when I save the record
and
then look at the information in the Expenses table, the AccountID
information is incorrect - it has not changed when I change the
ExpenseAccountName data.

This is MOST frustrating and strange.

Thank you.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.