Rowsource of combo box on subform

  • Thread starter janiotjoeawie via AccessMonster.com
  • Start date
J

janiotjoeawie via AccessMonster.com

I'm trying to change a rowsource of an combobox of a subform:

I've tried:
Name form: FRM_ALLOWANCES
Name controle subform: FRM_SUB_ALLOWANCES
Controle on subform : CURSISTID
Forms!FRM_ALLOWANCES!FRM_SUB_ALLOWANCES.CURSISTID.RecordSource = sSQL2

This gives me de error:
Object Doesn't Support This Property or Method.

What am I doing wrong?

I've seen treads where it was suggested to ues rowsourse but is also nog
doing the trick for me.

Regards and thanks in advance
 
S

Stefan Hoffmann

hi,

I'm trying to change a rowsource of an combobox of a subform:

I've tried:
Name form: FRM_ALLOWANCES
Name controle subform: FRM_SUB_ALLOWANCES
Controle on subform : CURSISTID
Forms!FRM_ALLOWANCES!FRM_SUB_ALLOWANCES.CURSISTID.RecordSource = sSQL2
You should use the correct property: RowSource, not RecordSource.

btw, where do you call this code? Where is sSQL2 populated?


mfG
--> stefan <--
 
P

Phil

hi,


You should use the correct property: RowSource, not RecordSource.

btw, where do you call this code? Where is sSQL2 populated?


mfG
--> stefan <--

Probably wrong but I think it should be
Forms!FRM_ALLOWANCES!FRM_SUB_ALLOWANCES.Form!CURSISTID.RowSource = sSQL2

Phil
 
J

janiotjoeawie via AccessMonster.com

Hi,

Rowsource does not do the trick for me.
It gives me the same error as RecordSource.

The sSQL2 is populated in the same routine.

Regards.

J.

Stefan said:
hi,
I'm trying to change a rowsource of an combobox of a subform:
[quoted text clipped - 3 lines]
Controle on subform : CURSISTID
Forms!FRM_ALLOWANCES!FRM_SUB_ALLOWANCES.CURSISTID.RecordSource = sSQL2
You should use the correct property: RowSource, not RecordSource.

btw, where do you call this code? Where is sSQL2 populated?

mfG
--> stefan <--
 
D

Douglas J. Steele

Forms!FRM_ALLOWANCES!FRM_SUB_ALLOWANCES.CURSISTID looks incorrect.

I'm guessing that CURSISTID is a combo box on form FRM_SUB_ALLOWANCES, which
is being used as a subform on FRM_ALLOWANCES. if that's the case, you need

Forms!FRM_ALLOWANCES!FRM_SUB_ALLOWANCES.Form!CURSISTID

If that doesn't work, make sure that the name of the subform control on
FRM_ALLOWANCES is actually FRM_SUB_ALLOWANCES. Depending on how you added
FRM_SUB_ALLOWANCES as a subform, the name of the subform control may be
something different. It's the name of the subform control you need, not the
name of the form being used as a subform if they are different.

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

janiotjoeawie via AccessMonster.com said:
Hi,

Rowsource does not do the trick for me.
It gives me the same error as RecordSource.

The sSQL2 is populated in the same routine.

Regards.

J.

Stefan said:
hi,
I'm trying to change a rowsource of an combobox of a subform:
[quoted text clipped - 3 lines]
Controle on subform : CURSISTID
Forms!FRM_ALLOWANCES!FRM_SUB_ALLOWANCES.CURSISTID.RecordSource = sSQL2
You should use the correct property: RowSource, not RecordSource.

btw, where do you call this code? Where is sSQL2 populated?

mfG
--> stefan <--
 
J

janiotjoeawie via AccessMonster.com

Douglas,

Thankx in a million. The exclamation mark did the trick.

Regards Jânio
Forms!FRM_ALLOWANCES!FRM_SUB_ALLOWANCES.CURSISTID looks incorrect.

I'm guessing that CURSISTID is a combo box on form FRM_SUB_ALLOWANCES, which
is being used as a subform on FRM_ALLOWANCES. if that's the case, you need

Forms!FRM_ALLOWANCES!FRM_SUB_ALLOWANCES.Form!CURSISTID

If that doesn't work, make sure that the name of the subform control on
FRM_ALLOWANCES is actually FRM_SUB_ALLOWANCES. Depending on how you added
FRM_SUB_ALLOWANCES as a subform, the name of the subform control may be
something different. It's the name of the subform control you need, not the
name of the form being used as a subform if they are different.
[quoted text clipped - 20 lines]
 

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