By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,694 Members | 1,795 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,694 IT Pros & Developers. It's quick & easy.

ControlSource and saving to table

P: n/a
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
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
What does a calculation have to do with storage? You have a control source
that is a calculation, so it displays the result of the calculation. I can't
tell what value you're thinking should have been stored in what (what is your
form bound to?) or how you think the value should know how to get to where you
want it to go.

On Sat, 2 Apr 2005 19:52:55 -0800, "Otie" <ot*********@adelphia.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.


Nov 13 '05 #2

P: n/a
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" <ot*********@adelphia.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.


Nov 13 '05 #3

P: n/a
Thank you so much!
--
---
Allen

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

"Ira Solomon" <is******@solomonltd.com> wrote in message
news:pa********************************@4ax.com...
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" <ot*********@adelphia.net>
wrote:
Is there a simple answer as to why my database will not save the datathat correctly appears in the AccountID textbox on a form to the tablewhen 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 andthen 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.

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.