473,320 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Populate Table based on value selected

Hi. *Very* green vb user building a db for marketing department ...

On my data entry form for a department, I have a list-box/drop down where user can choose that the address of the department is the same (or different) as the parent company (client). Upon selection of "client main" (indicating the address is the same), I want the address fields for the department to automatically be populated with the address information from the main client table.

My attempt pasted below returns the error:

'Run Time Error 438'
Object doesn't support this property or method.

Here is my attempted code:

Private Sub DAddressCk_Click()

If Me!DAddressCk.Value = 1 Then

Table![TblDepartment]![DAddress].Value = Table![TblClient]![Address].Value
Table![TblDepartment]![DCity].Value = Table![TblClient]![City].Value
Table![TblDepartment]![DState].Value = Table![TblClient]![State].Value
Table![TblDepartment]![DZip].Value = Table![TblClient]![Zip].Value

End If

End Sub


HELP is greatly appreciated!
Jul 21 '06 #1
1 1899
Hi. *Very* green vb user building a db for marketing department ...

On my data entry form for a department, I have a list-box/drop down where user can choose that the address of the department is the same (or different) as the parent company (client). Upon selection of "client main" (indicating the address is the same), I want the address fields for the department to automatically be populated with the address information from the main client table.

My attempt pasted below returns the error:

'Run Time Error 438'
Object doesn't support this property or method.

Here is my attempted code:

Private Sub DAddressCk_Click()

If Me!DAddressCk.Value = 1 Then

Table![TblDepartment]![DAddress].Value = Table![TblClient]![Address].Value
Table![TblDepartment]![DCity].Value = Table![TblClient]![City].Value
Table![TblDepartment]![DState].Value = Table![TblClient]![State].Value
Table![TblDepartment]![DZip].Value = Table![TblClient]![Zip].Value

End If

End Sub


HELP is greatly appreciated!

Hi,
If you want to populate it, use a DBlist or DBcombo box. Dblist if you want all the data in the field to appear one time and combo if you want it as a drop down list where you choose. then instead of Table![TblDepartment]![DZip].Value = Table![TblClient]![Zip].Value, you would write dblist.listfield= "x", where x is the field and dblist is the name of the dblist box.
Nov 15 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Greg Scharlemann | last post by:
I would like to automatically populate a drop down menu when the page loads based on the selection of an item in a different drop down menu. I made a test page that when drop down #1 changes, drop...
6
by: Joe | last post by:
I have 2 multi-list boxes, 1 displays course categories based on a table called CATEGORIES. This table has 2 fields CATEGORY_ID, CATEGORY_NAME The other multi-list box displays courses based on...
5
by: Chris | last post by:
I thought this would be simple and there would be advice / tutorials everywhere for this, but now that I'm working on it, I can't find any reference except for ASP or Javascript code. PHP/MySQL - ...
1
by: vj | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file? I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
0
by: vijendra | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file?I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
7
by: Simon Gare | last post by:
Hi, have form on asp page that recalls data from the recordset and populates all the fields except the dynamic dropdown box that doesn't, just shows default value. How do I make it populate...
5
by: joshua.nicholes | last post by:
I have an access database that consists of two tables.A data collection table and a species list table. The data collection table has about 1500 records in it and the species list has about 600....
4
by: whamo | last post by:
I have the need to populate a field based on the selection in a combo box. Starting out simple. (2) tables tbl_OSE_Info and tbl_Input; tbl_OSE_Info has three fields: Key, OSE_Name and OSE_Wt...
5
by: giandeo | last post by:
Hello Experts. Could you find a solution for this problem please! I have the following tables in Access Database Table Name: origin Fields Names: country, countrycode Table Name: make...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.