Solved

Referencing the combo box in the subform?

Posted on 2012-03-19
8
525 Views
Last Modified: 2012-03-19
I am trying to requery for the combo box in another form.

I have two forms.
frmPublication/frmqryAffiliatiion_subform
frmAuthor

When I adda new record in the frmAuthor, I want to requery the combo box in the subform of the frmPublication.

I don't see the control name for the combo box in the subform.
It is tied to the AuthorID so I am using the AuthorID as the controlID.

The subform has several textboxes to display the fields. I converted the textbox to a combo box.


How can I reference the combo box of subform in another form?

There is no field named "Forms!frmPublication.[frmqryAffiliation subform].Form.AuthorID in the current record.
0
Comment
Question by:dkim18
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 61

Assisted Solution

by:mbizup
mbizup earned 500 total points
ID: 37737512
Your syntax looks okay - I think you just need the correct name for your combo.

- Open your subform in design view
- Right click on your combo box and select 'Properties'
- Under the tab labeled 'Other', look for the Name property of your combo

That is the name that you should use in your syntax:


Forms!frmPublication.[frmqryAffiliation subform].Form.YourComboName
0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 37737561
On another note, the "subform name" should be the name of the subform control - which may be different from the name of the subform as it appears in the database window or navigation pane.

You can find the correct name by
- opening your main form in design view
- Right-clicking on the edge of the subform and selecting properties, and checking the Name property
0
 

Author Comment

by:dkim18
ID: 37737565
I have it as AuthorID.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 61

Expert Comment

by:mbizup
ID: 37737576
Can you upload a sample copy of your database, with any sensitive data removed?
0
 

Author Comment

by:dkim18
ID: 37737586
I check the subform name too, frmqryAffiliation Subform.
It is same.
0
 
LVL 40

Expert Comment

by:als315
ID: 37737657
Create empty query, use builder to select your field (start from main form, then select subform), copy full name of field from query builder to VBA code
0
 

Author Comment

by:dkim18
ID: 37737662
OK. I got it fixed.

I used the macro to requery.
It was giving me that errror.

I changed it to the event code and it is working fine.

Why would macro error out though?
0
 
LVL 61

Expert Comment

by:mbizup
ID: 37737677
I ran into siomething similar in another question recently.

In that case it turned out to be a timing issue -- the Macro was getting executed before the subform was actually loaded.

With VBA, the timing of form/subform events is a lot more clear-cut.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month11 days, 2 hours left to enroll

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question