473,396 Members | 1,936 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,396 software developers and data experts.

Get value from table upon changing value in combo box.

Tim
I'm working on a form where a combo box gets its list of values from a
table. That same table also contains some "default notes" in other
fields. My task is simple, but I'm having a hard time working it out.
Once an option is selected in the combo box, I want to run (a macro?)
that will grab the appropriate default notes from the table, and load
them into the form in the various Notes fields.

I've got a query set up that'll narrow the table down to the option
selected in the combo box, but when I use the SetValue action in the
macro, I get an error saying that I'm trying to use a table that is
not available for automation. Right now my SetValue action is set up
like this:

Item = [Forms]![FormMain]![Notes1TXT]
Expression = [ComboTable]![DefaultNote1]

Questions:
1. Can tables be referenced at all in SetValue actions in Macros? That
seems to be the hang up?
2. Is there a better way to go about this entirely?

Thanks in advance. Please email response to ti**********@gmail.com.
Thanks! :-)
Jun 27 '08 #1
1 2344
On Jun 6, 10:39*am, Tim <timothyda...@gmail.comwrote:
I'm working on a form where a combo box gets its list of values from a
table. That same table also contains some "default notes" in other
fields. My task is simple, but I'm having a hard time working it out.
Once an option is selected in the combo box, I want to run (a macro?)
that will grab the appropriate default notes from the table, and load
them into the form in the various Notes fields.

I've got a query set up that'll narrow the table down to the option
selected in the combo box, but when I use the SetValue action in the
macro, I get an error saying that I'm trying to use a table that is
not available for automation. Right now my SetValue action is set up
like this:

Item = [Forms]![FormMain]![Notes1TXT]
Expression = [ComboTable]![DefaultNote1]

Questions:
1. Can tables be referenced at all in SetValue actions in Macros? That
seems to be the hang up?
2. Is there a better way to go about this entirely?

Thanks in advance. Please email response to timothyda...@gmail.com.
Thanks! :-)
a combo box (cmbName) can have more than 2 fields
(I'm assuming you currently have 2)

if the current rowsource is "select id, name from table", change it to
"select id, name, notes from table"

under combo box properties, set columnCount to 3
and columnWidth to 0,1,0
(shows only name in box)

and the control source for notes1txt would be "=cmbName.column(2)"

now when you choose a new name from the combo box, the notes field is
updated accordingly
Jun 27 '08 #2

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

Similar topics

16
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not...
2
by: Ted | last post by:
How do I allow a user to enter a new value into a combo box for web-based (.Net) application? The orgiginal platform was a networked solution. The user could enter a new value if they didn't...
2
by: Terry Bickle | last post by:
Please forgive me for using the wrong term here or there. I'm an old Excel 4 macro guy who didn't convert to VB and I'm tinkering with an Access 2000 DB. I'm sure there is a simple Access 101...
3
by: MS | last post by:
What's the best way to "store" and display a value in a text box that changes from day to day. An example of this would be where the name of the user is manually typed in after using the datbase,...
6
by: JC21 | last post by:
Hi All, On my main table(tblCust) I have a field called Status, the default value is set to No. All the accounts currently in the table have a default value No. On my form I have a combo...
4
by: access baby | last post by:
i would like to use combobox or list box in a form for data entry do i have to have a table with value in it and the combobox or list box should look in to that table or i type in the values....
2
by: banderson | last post by:
Hello, I have a data entry form for a table with information about buildings and am having a problem making a combo box do what I want. I would like to make the combo box show a list of unique bldg...
2
by: Kaallis | last post by:
Hi there, Let me explain my problem more clearly: I have: a form FRM_Main 2 tables TBL_2007_OT and TBL_2007_Date a querry QRY_Dates_2007 The TBL_2007_Date is a number from 1 to 365 as...
6
by: David Wright | last post by:
Hello Folks I am using Microsoft Access 2000 I would be grateful if someone could help me with “Dlookup”. I tried various methods of writing Dlookup and various events to trigger it, none of...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.