473,770 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Text Autopopulated in Form Doesn't Display in Table

I inherited a database (as a novice at Access) and need to modify it to
make it more efficient, i.e., the assignment form needs to autopopulate
with the client's name, address, phone number, etc., when you select
the cust id. Found this cited as a good method:
http://www.mvps.org/access/forms/frm0058.htm

I have two tables (clients, assignments) and one form (assignment
input) in the database. I have a
control box called CUST ID in the assignment input form. I set the row
source type to table/query. I set the row source to the following:

SELECT Clients.Custome rID, Clients.Contact FROM Clients ORDER BY
CustomerID;

I then set the control source of the textbox (it was previously a combo
box with a drop down menu)to:

=[CUST ID].Column(1)

This results in the name of the client (contact) autopopulating when I
select the customer id. However, when I try to save the form I get this
error message: The field 'Assignment Data Sheet.Rec'd From' cannot
contain a Null value because the Required property for this field is
set to True. Enter a value in this field.

I tried removing the required property for that field from the
assignments table (my feeble attempt at troubleshooting ) and the
client's name that autopopulated in the form still does not appear in
the table. This is where I am stuck.

(Of course, I have other data that needs to autopopulate too. I just
need to make sure the method works before I add the additional code in
the row source of the CUST ID control.)

Dec 19 '06 #1
4 2738
Can I get a little help here? Please. If I need to explain something in
more detail, or if you have questions, please reply.

Thanks for your help.

rs******@hotmai l.com wrote:
I inherited a database (as a novice at Access) and need to modify it to
make it more efficient, i.e., the assignment form needs to autopopulate
with the client's name, address, phone number, etc., when you select
the cust id. Found this cited as a good method:
http://www.mvps.org/access/forms/frm0058.htm

I have two tables (clients, assignments) and one form (assignment
input) in the database. I have a
control box called CUST ID in the assignment input form. I set the row
source type to table/query. I set the row source to the following:

SELECT Clients.Custome rID, Clients.Contact FROM Clients ORDER BY
CustomerID;

I then set the control source of the textbox (it was previously a combo
box with a drop down menu)to:

=[CUST ID].Column(1)

This results in the name of the client (contact) autopopulating when I
select the customer id. However, when I try to save the form I get this
error message: The field 'Assignment Data Sheet.Rec'd From' cannot
contain a Null value because the Required property for this field is
set to True. Enter a value in this field.

I tried removing the required property for that field from the
assignments table (my feeble attempt at troubleshooting ) and the
client's name that autopopulated in the form still does not appear in
the table. This is where I am stuck.

(Of course, I have other data that needs to autopopulate too. I just
need to make sure the method works before I add the additional code in
the row source of the CUST ID control.)
Dec 19 '06 #2
rs******@hotmai l.com wrote:
I inherited a database (as a novice at Access) and need to modify it to
make it more efficient, i.e., the assignment form needs to autopopulate
with the client's name, address, phone number, etc., when you select
the cust id. Found this cited as a good method:
http://www.mvps.org/access/forms/frm0058.htm

I have two tables (clients, assignments) and one form (assignment
input) in the database. I have a
control box called CUST ID in the assignment input form. I set the row
source type to table/query. I set the row source to the following:

SELECT Clients.Custome rID, Clients.Contact FROM Clients ORDER BY
CustomerID;

I then set the control source of the textbox (it was previously a combo
box with a drop down menu)to:

=[CUST ID].Column(1)
+++++++++++++++ +++++++++++++++ ++++++++++
I think your problem is in the control field it is expecting to have
the CUST ID value populated in this field when you select a value from
the dropdown box NOT the Customer Name which I guess is column(1)! Also
check that you haven't changed your bound field value! However it is
more correct to only display the Customer details at run time rather
than storing them in the second table (replication and denormalisation
of your data) You should always aim to try to store data once!

It would also be worth checking the relationships window as that may
explain why removing the required property has no real effect, it is
likely that an explicit constraint has been made between the two
tables!

Good luck
purpleflash
+++++++++++++++ +++++++++++++++ ++++++++++
This results in the name of the client (contact) autopopulating when I
select the customer id. However, when I try to save the form I get this
error message: The field 'Assignment Data Sheet.Rec'd From' cannot
contain a Null value because the Required property for this field is
set to True. Enter a value in this field.

I tried removing the required property for that field from the
assignments table (my feeble attempt at troubleshooting ) and the
client's name that autopopulated in the form still does not appear in
the table. This is where I am stuck.

(Of course, I have other data that needs to autopopulate too. I just
need to make sure the method works before I add the additional code in
the row source of the CUST ID control.)
Dec 20 '06 #3
You may be right about the problem being in the control. As mentioned
previously, the control is a drop down box where the values from the
Clients table are displayed. In the present form of the database the
row source for the REC'D FROM control (or field of the assignments
table) is a follows:

SELECT Clients.Custome rID, Clients.Contact FROM Clients;

This apparently means that the name of the client (Clients.Contac t)
displays visually in the form but the CustomerID is also there but
hidden. I changed the content of the control by changing the control
source to read:

=[CUST ID].[Column](1)

Accordingly, only the contact is listed. I might try something like
this in the control source:

=[CUST ID].[Column](0), [Column](1)

Not sure if the syntax is right, but I will try to have the control
autopopulate with the Customer ID and Contact (but simply keep the
Customer ID hidden as it currently is). Does this sound valid? Or am I
rambling.

Anyway, thanks a lot, purpleflash. I will let you know the outcome of
my effort to change the control source code.

purpleflash wrote:
rs******@hotmai l.com wrote:
I inherited a database (as a novice at Access) and need to modify it to
make it more efficient, i.e., the assignment form needs to autopopulate
with the client's name, address, phone number, etc., when you select
the cust id. Found this cited as a good method:
http://www.mvps.org/access/forms/frm0058.htm

I have two tables (clients, assignments) and one form (assignment
input) in the database. I have a
control box called CUST ID in the assignment input form. I set the row
source type to table/query. I set the row source to the following:

SELECT Clients.Custome rID, Clients.Contact FROM Clients ORDER BY
CustomerID;

I then set the control source of the textbox (it was previously a combo
box with a drop down menu)to:

=[CUST ID].Column(1)
+++++++++++++++ +++++++++++++++ ++++++++++
I think your problem is in the control field it is expecting to have
the CUST ID value populated in this field when you select a value from
the dropdown box NOT the Customer Name which I guess is column(1)! Also
check that you haven't changed your bound field value! However it is
more correct to only display the Customer details at run time rather
than storing them in the second table (replication and denormalisation
of your data) You should always aim to try to store data once!

It would also be worth checking the relationships window as that may
explain why removing the required property has no real effect, it is
likely that an explicit constraint has been made between the two
tables!

Good luck
purpleflash
+++++++++++++++ +++++++++++++++ ++++++++++
This results in the name of the client (contact) autopopulating when I
select the customer id. However, when I try to save the form I get this
error message: The field 'Assignment Data Sheet.Rec'd From' cannot
contain a Null value because the Required property for this field is
set to True. Enter a value in this field.

I tried removing the required property for that field from the
assignments table (my feeble attempt at troubleshooting ) and the
client's name that autopopulated in the form still does not appear in
the table. This is where I am stuck.

(Of course, I have other data that needs to autopopulate too. I just
need to make sure the method works before I add the additional code in
the row source of the CUST ID control.)
Dec 20 '06 #4


rs******@hotmai l.com wrote:
You may be right about the problem being in the control. As mentioned
previously, the control is a drop down box where the values from the
Clients table are displayed. In the present form of the database the
row source for the REC'D FROM control (or field of the assignments
table) is a follows:

SELECT Clients.Custome rID, Clients.Contact FROM Clients;

This apparently means that the name of the client (Clients.Contac t)
displays visually in the form but the CustomerID is also there but
hidden. I changed the content of the control by changing the control
source to read:

=[CUST ID].[Column](1)
*************** ******
This code will attempt to store the data held in Column(1) when the
control needs to store the value in Column(0) to work. the source
should be just CUST ID.
*************** ******
>
Accordingly, only the contact is listed. I might try something like
this in the control source:

=[CUST ID].[Column](0), [Column](1)
*************** *******
The confusion here is between store and display I think - you need to
store ID and display NAME I don't think you should need to store NAME
as well!

Yep in combo boxes the displayed value is determined by the first
VISIBLE column value in the listing! If you change the bound value then
that is the value that will be put into the underlying table attribute!
To display the name for example select ID, Name from Clients set the
bound field to be column 1 (in properties the first column is 1 not 0
as it is in VBA!) and set the column count to 2 and the Column width
properties to 0cm,2cm and the total width to 2cm. then ID will be
stored but Name will be displayed!

If you set this up at table level (lookup tab) then any form will
inherit this setup when you drop the table attribute onto it! (even in
Datasheet view!)

If you really need to store the name as well you will need to add a
field to the underlying table and populate it from the combobox in code
(however this is really bad practice because it is always derived and
you are denormalising your table structure)

purpleflash

*************** **************

Not sure if the syntax is right, but I will try to have the control
autopopulate with the Customer ID and Contact (but simply keep the
Customer ID hidden as it currently is). Does this sound valid? Or am I
rambling.

Anyway, thanks a lot, purpleflash. I will let you know the outcome of
my effort to change the control source code.

purpleflash wrote:
rs******@hotmai l.com wrote:
I inherited a database (as a novice at Access) and need to modify it to
make it more efficient, i.e., the assignment form needs to autopopulate
with the client's name, address, phone number, etc., when you select
the cust id. Found this cited as a good method:
http://www.mvps.org/access/forms/frm0058.htm
>
I have two tables (clients, assignments) and one form (assignment
input) in the database. I have a
control box called CUST ID in the assignment input form. I set the row
source type to table/query. I set the row source to the following:
>
SELECT Clients.Custome rID, Clients.Contact FROM Clients ORDER BY
CustomerID;
>
I then set the control source of the textbox (it was previously a combo
box with a drop down menu)to:
>
=[CUST ID].Column(1)
>
+++++++++++++++ +++++++++++++++ ++++++++++
I think your problem is in the control field it is expecting to have
the CUST ID value populated in this field when you select a value from
the dropdown box NOT the Customer Name which I guess is column(1)! Also
check that you haven't changed your bound field value! However it is
more correct to only display the Customer details at run time rather
than storing them in the second table (replication and denormalisation
of your data) You should always aim to try to store data once!

It would also be worth checking the relationships window as that may
explain why removing the required property has no real effect, it is
likely that an explicit constraint has been made between the two
tables!

Good luck
purpleflash
+++++++++++++++ +++++++++++++++ ++++++++++
This results in the name of the client (contact) autopopulating when I
select the customer id. However, when I try to save the form I get this
error message: The field 'Assignment Data Sheet.Rec'd From' cannot
contain a Null value because the Required property for this field is
set to True. Enter a value in this field.
>
I tried removing the required property for that field from the
assignments table (my feeble attempt at troubleshooting ) and the
client's name that autopopulated in the form still does not appear in
the table. This is where I am stuck.
>
(Of course, I have other data that needs to autopopulate too. I just
need to make sure the method works before I add the additional code in
the row source of the CUST ID control.)
Dec 21 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
6932
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the JavaScript in this code from a couple different sites but I'm not 100% sure what each line is doing...This is the ASP code that I'm using for the page....Take a look at the JavaScript code and please let me know what each line is doing....I have been...
11
4663
by: bala | last post by:
hi!!! i need to display a disclaimer which is two page in length in a word document. i also need to format the text. the idea is something as follows on opening the application, a form which serves as splash screen with the disclaimer of the application is shown. now the problem i am running into is in the display of the disclaimer which is really two page long and it should be formatted too. using a textbox seems not
9
2359
by: Susan Bricker | last post by:
Greetings. I am having trouble populating text data that represents data in my table. Here's the setup: There is a People Table (name, address, phone, ...) peopleID = autonumber key There is a Judge Table (information about judges) judgeID = autonumber key
6
3337
by: Alpha | last post by:
I have several textboxes that I need to chang the text when the selection row is changed in a datagrid. I have the following code. This textbox displayes the initial selection but when I click on different rows in the datagrid, the textbox content doesn't change to reflect the change. How can I address this? Also, If the user change the text in the textbox then how do I refesh the display in the datagrid to reflect the changes? ...
11
8083
by: jimstruckster | last post by:
I have a table with 10 rows, I want all rows except for the first to be hidden when the page first opens up. If the user puts a value in a text box in the first row then I want the second row to display. If they put a value in the text box in the second row then display the third row etc. etc. etc. to 10 rows. I'm pretty new to javascript, so I'm not to sure where to start. Any help would be great, thanks a lot.
3
4011
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table with a createElement function to add additional entries. The table has the first row of input text boxes already in it. You have to click a button to add another row. That seems to be working fine. How do I pull the information from the input boxes...
2
3624
by: jw01 | last post by:
I have a form in which there is one combo box and three text boxes: Combo Box: -> Item A -> Item B -> Item C TextBox1: TextBox2: TextBox3:
1
4222
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being aligned to the top, along with the slideshow and link buttons, you have to scroll down to see the text - how can I make IE6 display correctly? http://geekarama.co.uk/new_home.html here is the code for new_home.html and following that the CSS...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10257
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10037
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9904
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7456
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.