f



Get value from table upon changing value in combo box.

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 timothydavie@gmail.com.
Thanks! :-)
0
6/6/2008 4:39:09 PM
comp.databases.ms-access 42670 articles. 0 followers. Post Follow

1 Replies
555 Views

Similar Articles

[PageSpeed] 35

On Jun 6, 10:39=A0am, Tim <timothyda...@gmail.com> wrote:
> 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 =3D [Forms]![FormMain]![Notes1TXT]
> Expression =3D [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 "=3DcmbName.column(2)"

now when you choose a new name from the combo box, the notes field is
updated accordingly
0
lesperancer (750)
6/6/2008 8:14:41 PM
Reply:

Similar Artilces:

Value in combo box determines which value (from two fields) get printed on report
I have an autograph database. I have a combo box field ("Object") with such values as "Signed Card", "Personally Inscribed Photo" and "Signed Photo". This tracks what kind of autograph I received. I have two currency fields: "Signature Value" and "Photo Value" that show estimated values of a signature or signed photo. The first is the value of a signature, and the second is the value of a signed photo. I want to be able to generate a report where the value of one of the two currency fields prints based on the value in the Object fiel...

Change a value in one table depending on the value(s) in another table
Hi, I want to change a value in one table depending on the value(s) in another table. I am trying to achieve this in a form. to elaborate I have a many-to-many relationship between tables Forms and Family and the associate table is called Forms_Family. Forms_Family have fields "dateSent" and "dateReceived". The Family table has a field called "familyStatus". I want to change the value of "familyStatus" field depending on the kind of form that has been sent and when it was received back: Forms_Family Table FamilyID | FormsID | dateSent | dateReceived ------------------------------------------------------------------------ 000 | form1 | 1/8/2003 | 001 | form2 | 5/9/2003 | in the above table when I receive form1 and as soon as I enter a date in "dateReceived" field I want the status of that particular family to change in the Family table Any help would be greatly appreciated.. Rex Rex, I figure somebody else will probably ask this question too before suggesting something; How will the value in the dat field determine the status? eg are all dates in december going to give one status and all dates in january going to give another status etc or are all dates within the last 30 days going to give one status and all dates between 30 and 60 days going to give another status etc or do you want one status if one set of forms has been sent, and another status if the forms have bee...

How to change the properties of Text box depending on the value of combo box.
Hi, I have created a combo box with "", Yes,No so that if user select any other option except Yes the text box should become disabled. For this I have written code in the exit event of the combo box it is working . But the problem is that, after reopening the form, if you navigate to same record it shows the check box enabled. Can anyone help me how to solve the problem. thanks Pervaiz Try using the same code in the 'On Current' event for the form. At present your code works ony if you exit the combo box, so when you open the form it won't run. With the 'On Curr...

change value in combo box
hi, i am experimenting with the Clarion drop down combo box since some days yet and now it gets somewhat annoying. All i wanna do, is to change the value of the combo box through my program. I tried it with all combinations of change(?cmbAny) and display (?cmbAny). I tried it with ?cmb...{prop:value} = ... I simply tried to change the underlying queue and display ... no success at all. At all it seems i accomplished to set the value of the combo box, but it's not displayed and that's confusing for the user. Any hints? thx brunft ...

How to display a value in a box related to the chosen value from the combo?
I have a combo box. How to display a value in a box in a form related to the chosen value from the combo? Bart Access v 2003 AA Arens wrote: > I have a combo box. How to display a value in a box in a form related > to the chosen value from the combo? > > Bart > Access v 2003 I have a 2 column list. I can access the value using the Column property. If colheadings is set to yes, you'd add 1 to the ListIndex part. Private Sub Combo2_AfterUpdate() MsgBox Me.Combo2.Column(0, Me.Combo2.ListIndex) 'first column (1-5) MsgBox Me.Combo2.Column(1, Me.Combo2.ListIndex) 'second colulumn (One...Five) End Sub On Jul 4, 9:59=A0pm, Salad <o...@vinegar.com> wrote: > AA Arens wrote: > > I have a combo box. How to display a value in a box in a form related > > to the chosen value from the combo? > > > Bart > > Access v 2003 > > I have a 2 column list. =A0I can access the value using the Column > property. =A0If colheadings is set to yes, you'd add 1 to the ListIndex p= art. > > Private Sub Combo2_AfterUpdate() > =A0 =A0 =A0MsgBox Me.Combo2.Column(0, Me.Combo2.ListIndex) 'first column = (1-5) > =A0 =A0 =A0MsgBox Me.Combo2.Column(1, Me.Combo2.ListIndex) 'second colulu= mn > (One...Five) > End Sub Hi, sorry I may have been not clear. What I am looking for is a way to add one or more values from a combobox added in a textbox. This can be done with or without an "Add" ...

Select box value changes value of hidden field
Hello, Another newbie here... I've been trying to make this work for days now and have finally decided to post as I can't seem to get it to work. Here's what I'm trying to do... I have a select box with three options and a separate hidden field. The value of a hidden field is dependent upon which of the three options is selected. For example, the three select options are 1, 2, 3... if 1 is selected, the value of the hidden field is 9.99, if 2 is selected the value of the hidden field is 12.99, if 3 is selected, the value of the hidden field is 15.99. Thanks in advance for ...

Import MS Office Excel Comma Separated Values Files into a MS Access 2003 database
Hi, I have been tasked with Importing MS Office Excel Comma Separated Values Files into a MS Access 2003 database. These files were exported from a DB2 database.I have also been given the DDL code. I have Googled a solution to this task and have tried creating these tables using the DDL code in a query within a blank MS Access database. Is there a more expedient way to achieve this? I noticed, for example, that a field in DB2 has a data type of "decimal" while the same field would have the data type of "number". Thanks, Zuf What follows is the DDL: -------...

Group category on report takes a value on the field from the table that uses combo box selection from another table
Hi, I am trying to create a report that takes a value from the field on a table as a group category. But The value on the report takes an id number (auto increment, and the first column) instead of second column. It is because the table takes a value from another table which takes a value from another table by a combo box selection. If I don't group on report, then this problem doesn't occur. So, there are two tables involved. Table1 just contains two fields: one is id and the other is year(i.e. 2000,2001...) and a field on Table2 takes a value from Table1 by combo box. I try to create a report based on Table1 and group by "year", I get "1" or "2" instead of "2000" or "2001". "1" or "2" just a first column. I try to change the "rowsource" property, but when you group, the group field doesn't have "rowsource" property. I will appreciate for some help on this. I may try to create a report from query instead of table. See how it works. Ikuyasu On May 3, 11:09=A0pm, ikuy...@gmail.com wrote: > Hi, > > I am trying to create a report that takes a value from the field on a > table as a group category. But > The value on the report takes an id number (auto increment, and the > first column) instead of second column. > It is because the table takes a value from another table which takes a > value from another table by a combo box selection. > > If...

Using a combo box to look up values and to enter new values
Hi, I have a form labeled DevList and I'm trying to make it look up names in the the "Last" column as well as be able to enter new names and still be able to fill out the form. Can someone help me with the coding? I think I need to use the NotInList property but I can't get it to code right! Thanks so much! What is the recordsource of your form? - Turtle "Amber" <amberblais@hotmail.com> wrote in message news:11f51495.0406221247.69db5525@posting.google.com... > Hi, > > I have a form labeled DevList and I'm trying to make it look up names &...

Combo box based on a table
Hi, I have a form which has subform. I added a combo box to this subform. The field is called SalesPerson each order has a sales person field so we can calculate comission attached to each order. This combo box is based on a table which has all the sales person name. The problem is when I select sales person from the drop down list, it changes to same sales person for all the order. I want each order as an independent event. how can I unlink them so if I chose different salesperson for second order then the first order stays the same. Thanks in advance "Joe Smith" <cg001@canada...

Using a combo box value to change a checkbox
I have a form (Form1) with a combo box (Combo43) with three values: Reference 1 Antenatal 1 Quant 1 I also have two check boxes (check36 and check34) What is the best way to implement such that when Reference 1 is selected in the combo box, check34 changes from false to true, and when Antenenal 1 or quant 1 is selected, check 36 changes to true? I've tried something along the lines of: Private Sub Combo43_AfterUpdate() If Me.Combo43 = "Reference 1" Then Me.Check32 = True Else Me.Check32 = False End If End Sub I'm a beginner at this, so any help would be amazing. Thanks! ...

How to change a value for only some values of a variable
Hello I have a data set with a character variable called CORE which is 7 characters long, the first 5 being numbers, the 6th a letter, the last a number. Whenever CORE ends in A2, I'd like to change it to end in A1, but keep the rest the same. Not quite sure how to do that. I've done this: data today; set sc.sc_v3; id = substr(core, 1,5); type = substr(core, 6,2); if type in ('b2', 'f2', 'g2') then delete; core = upcase(core); run; Any help appreciated. Peter Peter L. Flom, PhD Statistical Consultant www DOT peterflomconsulting DOT com ...

Getting values in between the values of a vector?
Say I have a vector that's like this: [-6 -3 0 3 6] How can I get it get the number in between each of the two values to return something like: [-4.5 -1.5 1.5 4.5] Is there a built-in function that can do this? I'm asking because I'd like to avoid a loop if possible (but I'm thinking it's the only way). Thanks! "Brandon Rodriguez" <coasters2k@yahoo.com> wrote in message <gsfp69$19b$1@fred.mathworks.com>... > Say I have a vector that's like this: > > [-6 -3 0 3 6] > > How can I get it get the number in between each of the two v...

value in list box or combo box
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 . On Apr 12, 10:29 am, "access baby" <nishkr...@gmail.com> wrote: > 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. &...

Re: combo box has problem getting the correct value from selection
My reply got in the wrong post, apologies.&nbsp; Was attempting to post in <a href="http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=135600" target="_blank">http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=135600</a> Message Edited by Dillon G on 04-04-2008 10:05 AM ...

Value if _page_ value into another value??
I am trying to get my Mtitle and Footer with in the dataset Instead of getting them as title and Footnotes the reason My boss requested (there is Other reason ) For that I am doing something like this My Problem is trying to get Titles in the Dataset, When I trying something like this The second title is Over writing the First one. But I need my Report some thing like this . Is there is something similar to *compute before _page_ or can I have value of _page_ into some other value.* MYPHARMA Page 1 of 3 . PEN 20007 Table 14.1.4 Demographic Characteristics Modified Intent-To-Treat Subjects /* CREATE REPORT */ ods rtf file = "&dir1.T14_1_2_MXXX_1303.RTF" style=autoexec; title "" ; Footnote"" ; proc report data= &Program. nowd missing split='?' style(header)=[protectspecialchars=off]; columns ("&border" (page _userFoot _PageNo _lastLine Sec Row Col0 Col2_1 Col2_1 Col2_2 Col2_3 Col2_4 )); define _userFoot / order Noprint ; define _PageNo / order Noprint ; define _lastLine / order Noprint ; define page/ order order=internal noprint; define Sec/ order noprint; define Row/ order noprint; define Col0 / display "Variable" style=[cellwidth=2.1in] style(header)=[just=left]; define Col2_1 /display "Placebo?(N=%cmpres(&all_plac.))&quo...

How to access a combo box value by providing the selection string from another vi.
Hi, &nbsp; I have a lower level communication vi with a combo box.&nbsp; I'm using the strings&amp;values[] property to initialize the combo box.&nbsp; When I select a string from the dropdown I get the corresponding value but when I pass in the same string from a caller vi I don't get the corresponding value.&nbsp; How can I access the value for the item I'm selecting from outside?? Perhaps you should just use the strings &amp; values property node to them out of the combo box, then search the 1-D array of clusters for the string that matches the one you are looking for, then return the corresponding value.&nbsp; Since it sounds like you are trying to access the control programmatically, use the programmatic features that are available. &nbsp; Maybe I'm mistaken in what you are trying to do, in which case please post some representative VI's. Thanks Ravens Fan, &nbsp; I did what you suggested.&nbsp; Looking at the text string property and&nbsp;searching the array for the correct value pair seems to work.&nbsp;&nbsp;I thought there was an easier way to access the values directly but this works too. What Rob described is exactly the behavior I was observing in my vi.&nbsp; It is good to know this type of information since&nbsp;I'm an experience programmer but new to Labview and I'm not aware of this kind of behavior.&nbsp; Also thanks for the enum tip.&nbsp; It's kind of frus...

Inserting value from MS Word into MS Access
If there are any enlightend souls out there that can help me, I would greatly appreciate it. I would like to use a macro to take a value and add it to an access database. I am having a problem with the very first line of code, Dim myDatabase as Database, the system does not recognize the Database object. PLEASE if there is anyone out there that has a piece of code that sends info from a word file into a access database... send it to me. I will Love you forever. Evan wrote: > If there are any enlightend souls out there that can help me, I would > greatly appreciate it. I would like to use a macro to take a value and > add it to an access database. > > I am having a problem with the very first line of code, > Dim myDatabase as Database, the system does not recognize the Database > object. Add a reference to DAO or use an Object variable and late bind it (set db=CreateObject("DAO.Database"), although the first way will give you intellisense. -- \\\\\\ \\ \\ Windows is searching \ \ For your sig. \ \ Please Wait. \__\ mmm, I am sorry - I am really new at this... I have added the ADO reference, and I want to execute this SQL - "insert into documents (title) values ('testTitle')" How do I write the actual code, I had it before but then I deleted the wrong file... now I am back at square one Evan wrote: > mmm, I am sorry - I am really new at this... I have added the ADO > referenc...

UPDATE VALUE IN ACCESS DATABASE-CONNECTIVITY DATABASE?
Hi to all labviewers, I'm trying to update some values in my access database with sql and labview connectivity toolset but i got an error, what is the problem whit my code? note: when i try to update one colum it's work fine. &nbsp; regard's eyal. UPDATE_ACCESS.JPG: http://forums.ni.com/attachments/ni/170/152737/1/UPDATE_ACCESS.JPG This is a multi-part message in MIME format. ------=_NextPart_000_0066_01C5EE8B.DE98AE20 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I'm not sure if you can use comma's to se...

How to Interrogate SQL Server Tables for Specific Values
In MS Access I have a routine as follows that interrogates all the tables in the database looking for a certain value. I am looking for similar routine for SQL Server. It needs to to be run at the server and not link to the tables. First the MS Access routine runs to create three tables. XYZTables, XYZFields, and XYZResults and populates XYZTables and XYZFields. XYZFields is needed for the Interrogation routine that follows: Public Sub DocumentTables() Dim db As DAO.Database, tbl As DAO.TableDef, fld As DAO.Field Dim rstTable As DAO.Recordset, rstField As DAO.Recordset Dim t A...

Combo box LimitToList property setting of No
Combo box LimitToList property setting of No does not prevent the MS Access error "The text you enter must match an entry in the list" from popping up. What makes this bad is that the error is not a capturable error. My list has 2 fields: [Reason] and [ReasonCode]. The 2nd column is the bound column. Here's the RowSource property setting: Select [Reason],[ReasonCode] From [tblReasons]; I want the user to select a reason from the list, of course. But I DON'T want the user to see a MS Access error pop up in an app I rollout in a runtime environment built using Access 2.0 a...

Not getting value for second combo box "with" statement & Dcount help
Hi I'm pretty new to Access here (using Access 2000), and appreciate the help and instruction. I gave myself 2.5 hours to research online and help and try to get this one, and I am not getting it. Simple database: I want to have a user enter Supply Orders (just for tracking purposes) by Item. The user may also enter a new item - "new" is a combination of Item, PartNumber and Vendor - they could have the same item and partnumber purchased from a different source. Item and Vendor are "self-updating" combo boxes - adds the item if it's not in the list. I am tryin...

Newbie: Changing value of css value.
How can i use javascript to change: <div style="display: none"> </div> to: <div style="display: block"> </div> -- JJ Harrison noodle_snacks@yahoo.com.au Somehow you have to get a reference to the div. A standard way is to give it an id like so: <div id=myFavoriteIdName style="display:none">My div text</div> and then in your javascript you can do: var myDiv = document.getElementById("myFavoriteIdName"); myDiv.style.display = "block"; Csaba Gabor from New York "JJ Harrison" <lizne...

changing old values to new values
I just would like to re-explain the problem i am having as i had not received any posts, so i might of explained in poorly. The problem i am having is NOT parse error related, more or less a problem in my logic. Ok , well what is happening is i am getting my values in member.txt fields ok from reading it, but when i attempted to write those values back to the member.txt file with updated string values, my member.txt file is cleared of all values, and i think my array is been wiped. Here is the updated code: if(isset($_POST['Submit'])) { //Store profile in username.txt $fileName .= ...

Web resources about - Get value from table upon changing value in combo box. - comp.databases.ms-access

The Changing Light at Sandover - Wikipedia, the free encyclopedia
"The Changing Light at Sandover" is a 560-page epic poem by James Merrill (1926–1995). Sometimes described as a postmodern apocalyptic epic, ...

Is Facebook Changing How We Travel?
When one of your Facebook friends posts a photo album of their trip to Maui, they’re not just showing off — they might also be acting as a travel ...

Missed this week's Changing Track?... - 774 ABC Melbourne - Facebook
Missed this week's Changing Track? We've got you covered. Like to submit your own? Email it to 774drive@abc.net.au

Facebook changing PMD program to Facebook Marketing Partners
Facebook’s Preferred Marketing Developer program may be getting a new look. Earlier today, Facebook announced on the Facebook for Business page ...

Changing Lanes (@chginglanes) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Changing the way business decisions are made
We believe that social data has unlimited value, and near limitless application. Today, we’re taking an important step toward unleashing this ...

12 Minutes To Create a Mind-Changing Presentation
... draft great presentations and to become a more effective and convincing presenter. Twelve minutes which can 12 Minutes To Create a Mind-Changing ...

We're Changing Our Name (Back) to Stack Overflow
We are Stack Overflow. You may know us from such popular websites as Stack Overflow Q&A, Stack Overflow Careers, The Stack Exchange Q&A Network, ...

The Tao of Twitter: Changing your life and business 140 characters at a time - Amazon
It's time to take the mystery out of Twitter. Twitter may be the most powerful business and personal networking platform ever created but it ...

App Store - Voices 2 ~ fun voice changing!
Read reviews, get customer ratings, see screenshots, and learn more about Voices 2 ~ fun voice changing! on the App Store. Download Voices 2 ...

Resources last updated: 3/20/2016 4:32:24 PM