If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Combo Box Help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 17
Combo Box Help

Hello Again.
I am having an issue with my combo box. The code I am using is not populating my other boxes.
attached is my database. and form.
This is the code I am using for the combo box.
It is not pulling in the data from the query.



Private Sub Combo69_Change()
Me.txtMATL_.Value = Me.Combo69.Column(1)
Me.txtFINISH.Value = Me.Combo69.Column(2)


End Sub

I have several other fields that need to be filled in.
I was hoping that this would work but it is not.
Any other ideas by chance?
Attached Files
File Type: zip blank.zip (74.6 KB, 2 views)
Reply With Quote
  #2 (permalink)  
Old
Moderator
 
Join Date: Jun 2005
Location: Richmond, Virginia USA
Posts: 2,507
I can't open your attachment, as I only run v2007. How do you define 'not working?' Nothing happens? The Controls are populated, but with the wrong data?

As you've got it, your Combobox has to have at least three columns, with the data for txtMATL_ in the 2nd column and the data for txtFINISH in the 3rd column.

Also, is the name of the Textbox really txtMATL_? Most unusual to have an Underline character as the last character in a name!

Linq ;0)>
__________________
Hope this helps!

The Devil's in the Details!!

All posts/responses based on Access 2003/2007
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 17
the txtmatl and txtfinish boxes are not populating with the selection from combo boxes
Ive also tried dlookup

aka
Me.txtfinish.Value = DLookup("finish", "mml_lom_1", "parts_id = '" & Me.Combo71 & "'")
in the change()
Reply With Quote
  #4 (permalink)  
Old
Moderator
 
Join Date: Jun 2005
Location: Richmond, Virginia USA
Posts: 2,507
On the Current Record are you physically making a selection from Combo69, i.e. dropping down the list and selecting an item, as opposed to assigning a Value to the Combobox through code or by having a Default Value assigned? Events associated with Controls, such as the OnChange event, only fire when data is physically entered/selected, not when done through code.

Linq ;0)>
__________________
Hope this helps!

The Devil's in the Details!!

All posts/responses based on Access 2003/2007
Reply With Quote
  #5 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 17
On the current record, in the form, I am selecting by description. It is a dropdown combo box. The record should not contain any default value, for the description.
If you look at the other boxes. It will be
txtmanufacturer txtelec txtfinish txtU_M those are coming from (a query) I was trying
and then tried to do a maketable query to see if it would work better.
see the zip. it has the mml_lom table
Attached Files
File Type: zip blank (3).zip (85.8 KB, 1 views)
Reply With Quote
  #6 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 17
So should it be on afterupdate(). I've also attempted to try that too
Reply With Quote
  #7 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 17
Reply With Quote
  #8 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 17
would this be better?Private Sub Combo71_AfterUpdate()

Me.txtUNIT_WT_LBS.Value = DLookup("unit_weight", "mml_lom_1", "parts_id = '" & Me.Combo71.Value & " '")

Me.Combo71.Requery

End Sub
Reply With Quote
  #9 (permalink)  
Old
Moderator
 
Join Date: Jun 2005
Location: Richmond, Virginia USA
Posts: 2,507
Actually, both the OnChange and AfterUpdate events should work fine with this. Using DLookup along with a Combobox is only necessary if one of the Fields being retrieved is a Memo Field, as Comboxes will truncate them.

I can't run the MRF_LOM1 Form or even go into Design View for the Table of the same name, because you're apparently using some Access 2010-only feature in the Table, maybe a Multi-Value Field, and I don't run 2010.

I can't check, but are you sure that the Form in question, in question, can be updated, i.e. isn't Read-Only? Without my being able to run the Form, I can't check this out for myself, or even verify that your problem exists, on my machine. I'm really very limited in going much further for you with this; hopefully someone running v2010 will come along and have a further look at it for you.

Linq ;0)>
__________________
Hope this helps!

The Devil's in the Details!!

All posts/responses based on Access 2003/2007
Reply With Quote
  #10 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 17
great...
very much stuck on this stupid little part
Reply With Quote
  #11 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 17
ok fixed
see it now
Attached Files
File Type: zip 1blank.zip (35.5 KB, 1 views)
Reply With Quote
  #12 (permalink)  
Old
Moderator
 
Join Date: Jun 2005
Location: Richmond, Virginia USA
Posts: 2,507
Glad you've got it working for you! But forum etiquette requires that you post what the resolution was! I can't tell what you changed, because I couldn't access your original Form. You also need to post it on the other forum where you had this posted.

Have you noticed that you're populating a Field named FINISH with a value from a Field named UNIT_WEIGHT, rather than one named PARTS_FINISH?

Code:
SELECT [table_k_query_1].[PARTS_DESCRIPTION], [table_k_query_1].[PARTS_MATERIAL], [table_k_query_1].[UNIT_WEIGHT] FROM table_k_query_1 ORDER BY [PARTS_DESCRIPTION];
As you've seen here, it'll always be easier getting help if you post a copy of your file in Access 2003 format, since many here are still running that version and cannot open 2007/2010 files.

Linq ;0)>
__________________
Hope this helps!

The Devil's in the Details!!

All posts/responses based on Access 2003/2007
Reply With Quote
  #13 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 17
the enabled content part was failing on me
want to shoot my foot off
I know that the combobox.(1) does not work on web based forms.
I will take a look at our code after lunchtime!
shooot my foot off please
Reply With Quote
  #14 (permalink)  
Old
Moderator
 
Join Date: Jun 2005
Location: Richmond, Virginia USA
Posts: 2,507
If you're posting a question about web-based forms you really need to say that up front! Many things are different, when doing this kind of thing on a web-based forms!
__________________
Hope this helps!

The Devil's in the Details!!

All posts/responses based on Access 2003/2007
Reply With Quote
  #15 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 17
I saw that linq afterwards too. Thanks for the update
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On