Solved

Referencing the combo box in the subform?

Posted on 2012-03-19
8
506 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
 
LVL 61

Expert Comment

by:mbizup
ID: 37737576
Can you upload a sample copy of your database, with any sensitive data removed?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

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

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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now