473,507 Members | 12,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ControlSource and saving to table

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
3 2580
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4194
by: Shelli Carol | last post by:
Good day, I have: 1) A table with numbered fields (1, 2, 3, etc.) 2) A form text box, whose ControlSource property contains an expression. This expression returns a number. If I just...
13
7353
by: Stuart McGraw | last post by:
I haven't been able to figure this out and would appreciate some help... I have two tables, both with autonumber primary keys, and linked in a conventional master-child relationship. I've...
1
3481
by: Mexar | last post by:
My programming grammar might be a little off but I have a pretty good idea of what I need to convey. I am making an Access database with a form that pops up and lets you choose to select an...
2
2210
by: jessDMiller | last post by:
I have no clue why the data from the form isn't saving into the database. What am I doing wrong? addAnnounce.php: <td align=top> <form action="index2.php" method="post">Heading:<br...
3
2969
by: Michael R | last post by:
Hello. I need a help to solve the following: I'm intersted in having the Control Source of a textbox as following: ="Comment, " & When I input this from Design View into the Control...
2
3966
by: brnkstyle | last post by:
I want to change the controlsource of a textbox when i click a command button but everytime i do so it gives me #Name$ in the text boxt this is what i want to control source to be ...
13
5766
by: ringer | last post by:
Hi, I have a text box on report where I need to have dsum return a total. The records I need the total from are not in the table that is the report's recordsource, and to complicate things...
0
1606
by: =?Utf-8?B?Q2hyaXN0aWFuIEJhaG5zZW4=?= | last post by:
Is it possible to bind a data access page textbox controlsource property at run time? I've tried using the BeforeInitialBind event to set the controlsource for textboxes, using syntax like ...
14
10009
by: OldBirdman | last post by:
I have a textbox on a continuous form that I want to display a calculated value. I have set the ControlSource Property = & "~" & . I would like to have my user be able to correct this value, and...
0
7221
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7109
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7029
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5039
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1537
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.