473,804 Members | 3,153 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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**********@gm ail.com.
Thanks! :-)
Jun 27 '08 #1
1 2375
On Jun 6, 10:39*am, Tim <timothyda...@g mail.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...@gm ail.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.colum n(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
11501
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 an object... the function is like so: function calc_total() { var x,i,base,margin,total,newmargin,newtotal; base = document.frmKitAmount.txtTotalKitValue.value; margin = document.frmKitAmount.margin.value/100;
2
3884
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 find what they were looking for in the pull-down list. The new value would be entered only into the current record. The new platform is being developed with ASP.Net, VisualBasic.Net and C#.
2
8239
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 answer for this. I have a subform which the user selects an item description from a combo box from a table. I want to obtain the cost for the item (another field in the table) also. I've been able to produce the second data field by rewriting the...
3
2127
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, along with (say) the date. ATM, I have a table with (say) 4 fields. Each field is linked to a column in a combo box. The combo box is invisible on the form. The text boxes display previous data using code something like this... Private Sub...
6
2616
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 box(cboCust) when an option is selected from the combo box, the account is copied to another table. In the After Update event in the combo box there is an event procedure. My question is there a way for me to change the default value of that account in the...
4
7494
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. 'cause when i create a form with text box and change it to combobox the box is empty there are no records in it .
2
3898
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 mgmt company names and then to open a building management company form to show all records with this name, so the user can find the correct branch location to select. Then, upon closing the building management company form, the active/selected record...
2
1530
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 primary key and the date associated to it. ex: 1 would be 1/1/2007.
6
5190
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 which were successful. I have been able to display the required value in a ‘text box’ which is a little helpful but not ideal. I have a table called tblLogSheet. The ‘Description’ field of this table uses a lookup table called...
0
9708
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9587
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
10588
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
10340
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
10324
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
10085
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...
0
6857
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5662
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3827
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.