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
Solved

Referencing the combo box in the subform?

Posted on 2012-03-19
8
520 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
  • 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
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 …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

839 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