Case select syntax

M

maceslin

When exit cboDOTMLPF on frmSolutions I am trying to use case select to
populate cboSolLoc on subfrmSolLoc with the following code (only one
of 8 cases)

Private sub cboDOTMLPF_Exit(Cancel as integer)
Select Case cboDOTMLPF.value
 
M

maceslin

When exit cboDOTMLPF on frmSolutions I am trying to use case select to
populate cboSolLoc on subfrmSolLoc with the following code (only one
of 8 cases)

Private sub cboDOTMLPF_Exit(Cancel as integer)
Select Case cboDOTMLPF.value

Machine hiccuped- lets try again
When exit cboDOTMLPF on frmSolutions I am trying to use case select to
populate cboSolLoc on subfrmSolLoc with the following code (only one
of 8 cases)

Private sub cboDOTMLPF_Exit(Cancel as integer)
Select Case cboDOTMLPF.value
Case Doctrine
frmSolLoc!cboSolLoc.RecordSource=tblDoctrineSolLoc.DoctrineSolLoc

End Select
End Case

There is nothing in cboSolLoc

ANy ideas what wrong with syntax?

Thanks
Dave
 
D

Dirk Goldgar

Two points:

Point 1:
Case Doctrine

If Doctrine is supposed to be a literal value, it should be enclosed in
quotes:

Case "Doctrine"

Point 2:
frmSolLoc!cboSolLoc.RecordSource=tblDoctrineSolLoc.DoctrineSolLoc

Combo boxes don't have a RecordSource property; it's "RowSource". So
*maybe* your line of code should be:

frmSolLoc!cboSolLoc.RowSource=tblDoctrineSolLoc.DoctrineSolLoc

But I don't understand what "tblDoctrineSolLoc.DoctrineSolLoc" is supposed
to be. Are you trying to set the rowsource to a query that selects the
field DoctrineSolLoc from table tblDoctrineSolLoc? If so, the above line
should probably be this instead:

frmSolLoc!cboSolLoc.RowSource = _
"SELECT DoctrineSolLoc FROM tblDoctrineSolLoc"

It's all guessing, though, because your explanation was rather vague.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


When exit cboDOTMLPF on frmSolutions I am trying to use case select to
populate cboSolLoc on subfrmSolLoc with the following code (only one
of 8 cases)

Private sub cboDOTMLPF_Exit(Cancel as integer)
Select Case cboDOTMLPF.value

Machine hiccuped- lets try again
When exit cboDOTMLPF on frmSolutions I am trying to use case select to
populate cboSolLoc on subfrmSolLoc with the following code (only one
of 8 cases)

Private sub cboDOTMLPF_Exit(Cancel as integer)
Select Case cboDOTMLPF.value
Case Doctrine
frmSolLoc!cboSolLoc.RecordSource=tblDoctrineSolLoc.DoctrineSolLoc

End Select
End Case

There is nothing in cboSolLoc

ANy ideas what wrong with syntax?

Thanks
Dave
 
S

Stuart McCall

When exit cboDOTMLPF on frmSolutions I am trying to use case select to
populate cboSolLoc on subfrmSolLoc with the following code (only one
of 8 cases)

Private sub cboDOTMLPF_Exit(Cancel as integer)
Select Case cboDOTMLPF.value

Machine hiccuped- lets try again
When exit cboDOTMLPF on frmSolutions I am trying to use case select to
populate cboSolLoc on subfrmSolLoc with the following code (only one
of 8 cases)

Private sub cboDOTMLPF_Exit(Cancel as integer)
Select Case cboDOTMLPF.value
Case Doctrine
frmSolLoc!cboSolLoc.RecordSource=tblDoctrineSolLoc.DoctrineSolLoc

End Select
End Case

There is nothing in cboSolLoc

ANy ideas what wrong with syntax?

Thanks
Dave

No such thing as End Case in VB(A). Remove that line.
 
M

maceslin

Good spot.  I didn't notice that.

All good comments- it was the end of a long day and U should have jsut
backed off and relooked at it tomm, suspect above will fix all for me
 
L

Linq Adams via AccessMonster.com

Also, when using a selection from a combobox, you should always use its
AfterUpdate event, not the OnExit event. With the OnExit event, if the user
should tab thru the combobox again, say in moving to another control, the
code would fire again, needlessly.
 

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