Tab Controls in a Sub-form.

C

CSLB

I have a problem with my syntax. How would I correct this
line of code below so that I can reference a listbox that
is located on a tab page where the tab control is a
sub-form of another form.

Forms!frmImport.tabView!lstView.RowSourceType = "Value List"

Thanks in Advance.

Colette.
 
T

tina

first, i take it that you mean the tab control is ON a sub
form of the main form. second, are you referencing the
listbox from within the subform or from within the main
form?

if in the main form, try this

Forms!MainFormName!SubFormName!ListboxName.RowSourceType

make sure the "SubFormName" is the name of the subform
control in the main form - sometimes that is different
from the name of the subform object in the database window.

if in the subform, try this

Me!ListboxName.RowSourceType


hth
 
G

Guest

Thank you Tina.

I started with 2 subforms within the main form but later
changed it to a 2-page tab control in the main form.
 
V

Van T. Dinh

Don't worry about the TabControl. It doesn't affect the
reference to a Control.

You need:

Forms!frmImport!SubformCONTROLName.
Form!lstView.RowSourceType = "Value List"

(type as one line in your code.)

Note that the SubformCONTROLName may be different from the
name of the Form being used as the Subform (more
accurately, being used as the SourceObject of the
SubformControl). You need to check the name of the
SubformControl in the design view of your (main) Form.

HTH
Van T. Dinh
MVP (Access)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top