Solved

Referencing the combo box in the subform?

Posted on 2012-03-19
8
522 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

738 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