Question -Invalid procedure call

  • Thread starter Thread starter Junior
  • Start date Start date
J

Junior

I have a cbo box and trying to use the value of col(3) in an if statement
Error returned
'Invalid procedure call or argument
strPLic = Nz(Me!cboAppPos.Column(3), "ZZ")
If strPLic = "L" And strLic <> "Y" Then
MsgBox "This position requires a current license ", , vbCritical,
"Licensure Alert"
End If

how should/can I get the value??
Thanks
 
Junior said:
I have a cbo box and trying to use the value of col(3) in an if
statement Error returned
'Invalid procedure call or argument
strPLic = Nz(Me!cboAppPos.Column(3), "ZZ")
If strPLic = "L" And strLic <> "Y" Then
MsgBox "This position requires a current license ", , vbCritical,
"Licensure Alert"
End If

how should/can I get the value??
Thanks

How many columns are in this combo box? The third column should be
referred to in code as Column(2), as the Column property is 0-based.
 
Dirk - there are 4 columns in the cbo - below is the SQL for the cboAppPos

SELECT [TlkpAppPosition].[PosID], [TlkpAppPosition].[PosDesc],
[tlkpAppPosition].[PosType], [tlkpAppPosition].[Lic] FROM TlkpAppPosition
WHERE [tlkpAppPosition].[PrintOrder]<9 ORDER BY
[TlkpAppPosition].[PrintOrder];
 
Junior said:
Dirk - there are 4 columns in the cbo - below is the SQL for the
cboAppPos

SELECT [TlkpAppPosition].[PosID], [TlkpAppPosition].[PosDesc],
[tlkpAppPosition].[PosType], [tlkpAppPosition].[Lic] FROM
TlkpAppPosition WHERE [tlkpAppPosition].[PrintOrder]<9 ORDER BY
[TlkpAppPosition].[PrintOrder];


Dirk Goldgar said:
How many columns are in this combo box? The third column should be
referred to in code as Column(2), as the Column property is 0-based.

I don't think it's the combo box column reference after all. I think
it's the MsgBox statement, which has an extra comma after the Prompt
argument.
 
Dirk - thanks - i've been looking at this and missing it completely- another
lesson learned...

Dirk Goldgar said:
Junior said:
Dirk - there are 4 columns in the cbo - below is the SQL for the
cboAppPos

SELECT [TlkpAppPosition].[PosID], [TlkpAppPosition].[PosDesc],
[tlkpAppPosition].[PosType], [tlkpAppPosition].[Lic] FROM
TlkpAppPosition WHERE [tlkpAppPosition].[PrintOrder]<9 ORDER BY
[TlkpAppPosition].[PrintOrder];


Dirk Goldgar said:
I have a cbo box and trying to use the value of col(3) in an if
statement Error returned
'Invalid procedure call or argument
strPLic = Nz(Me!cboAppPos.Column(3), "ZZ")
If strPLic = "L" And strLic <> "Y" Then
MsgBox "This position requires a current license ", ,
vbCritical, "Licensure Alert"
End If

how should/can I get the value??
Thanks

How many columns are in this combo box? The third column should be
referred to in code as Column(2), as the Column property is 0-based.

I don't think it's the combo box column reference after all. I think
it's the MsgBox statement, which has an extra comma after the Prompt
argument.

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

(please reply to the newsgroup)
 
Back
Top