473,412 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,412 software developers and data experts.

Appending the value of a listbox

This seems like it should be easy, but I am stuck! I have a listbox in a form that has a single value. This value is based on the results from a combobox in the same form. I want to than take that listbox value and append it to a table, but I keep getting a null error. Looking this up, I need to access the selected property, but that's where I get confused.

The listbox is called txtScientificName and is found in a Navigation Subform. I can provide more info if needed, I am just not sure what would be helpful.

I am using this in an append query to try and append the value into a table:
Expand|Select|Wrap|Line Numbers
  1.  [Forms]![NavfrmEnviroscienceSampleCodes]![NavigationSubform]![txtScientificName] 
Nov 3 '15 #1

✓ answered by zmbd

Navigation subform controls are truly wonderful to work with... "bazinga"

you might find this frustration of mine to be helpful
https://bytes.com/topic/access/answe...ol#post3732430

and some more useful tidbits:
https://bytes.com/topic/access/answe...rm#post3771135

So to the meat of the beast.

The Parent form has this:
NavigationControlSubFormContainer
(this would be your ]![NavigationSubform]![)

This is just the container... see my post here that describes the silly thing: https://bytes.com/topic/access/answe...ms#post3760995

So, You open the parent, click on a navigation-subform-control-tab, it loads the associated form.

At this point, ignore everything you've learned about referring to controls on the loaded form within in the navigation subform control... go right for Neopa's suggestion that worked for me in the first link above to refer to the controls on the loaded subform.
NeoPa: (...) try referencing the control name directly and on its own (...)
What you are not telling us is how you are attempting to create your append-query and that may alter how we approach the situation.

-z

3 1011
zmbd
5,501 Expert Mod 4TB
Navigation subform controls are truly wonderful to work with... "bazinga"

you might find this frustration of mine to be helpful
https://bytes.com/topic/access/answe...ol#post3732430

and some more useful tidbits:
https://bytes.com/topic/access/answe...rm#post3771135

So to the meat of the beast.

The Parent form has this:
NavigationControlSubFormContainer
(this would be your ]![NavigationSubform]![)

This is just the container... see my post here that describes the silly thing: https://bytes.com/topic/access/answe...ms#post3760995

So, You open the parent, click on a navigation-subform-control-tab, it loads the associated form.

At this point, ignore everything you've learned about referring to controls on the loaded form within in the navigation subform control... go right for Neopa's suggestion that worked for me in the first link above to refer to the controls on the loaded subform.
NeoPa: (...) try referencing the control name directly and on its own (...)
What you are not telling us is how you are attempting to create your append-query and that may alter how we approach the situation.

-z
Nov 4 '15 #2
Thank you zmbd,

I tried setting the reference control name directly on its own, but that didn't seem to work. I read through the links, but nothing was clicking on that old light bulb....So I stepped away from this for about a week to think about it, and I came up with a work around. I changed the combo box that I wanted populated based on the selection from another combo box to a text box. I then adjusted the query that was the basis for the combo box to include the fields I wanted (basically creating another column for the combo box). Then I used VBA and in the AfterUpdate property of the combo box, I have it update the values of the txt boxes based on the combobox's column(1).

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmbAbbreviatedScientificName_AfterUpdate()
  2. Me.cmbScientificName = Me.cmbAbbreviatedScientificName.Column(1)
  3. Me.Refresh
  4. End Sub
Thank you again for the references, Navigation Forms certainly make my head hurt!

R
Nov 12 '15 #3
zmbd
5,501 Expert Mod 4TB
That is the truth. (@_@)

Something I've ran in to when working with these, especially the navigation-form-control-buttons (I refuse to call them tabs :) ) is that often when changing a property, the change doesn't take until you save, close, and then re-open the parent navigation form --- keep that in mind if you start experiencing that the parent form isn't working as expected - design-view > save > close > re-open

BOL W/Project

-z
Nov 12 '15 #4

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

Similar topics

3
by: MLH | last post by:
I have a query, qryAppend30DayOld260ies that attempts to append records to tblCorrespondence. When run, it can result in any of the following: appending no records, appending 1 record or appending...
1
by: pcb | last post by:
Hi all, Perhaps a silly question. I've been trying to format the list items in a listbox by appending a constant text string to the values. Here is the code: ******** 'Build SQL string...
3
by: Bernardo | last post by:
Hi, Hi have a Listbox whith some values but I want to select the first line and execute the routine on_click. I selected allready the list value, but how can Y force the click event? Thanks...
5
by: Paul | last post by:
Hi I have a listbox and have the selection mode set to multiple in the property box. I am trying to set multiple selected values in code but it only seems to use the last one....
4
by: John A Grandy | last post by:
could someone explain the following to me : Appending the literal type character I to a literal forces it to the Integer data type. Appending the identifier type character % to any identifier...
3
by: Jonnh | last post by:
to use the the property list in the object listbox txtidcodigoencontrado.Value = listbox.List(2) it generates me a compilation error":
6
by: GS | last post by:
how can I set tooTip on ToolTip1 for a listbox?
0
by: =?Utf-8?B?UGF1bA==?= | last post by:
I have a ListBox server control named "lb_dates" with a SelectionMode of "Multiple". The user can select multiple dates from the listbox. I have ObjectDataSource named "ods_rfq" with a...
4
by: hvsummer | last post by:
Hi guy, this is another core question. While I can't handle with OLE error on this link...
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:
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...
0
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,...
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,...
0
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...

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.