Constant Error

Alhakeem1977

Registered User.
Local time
, 01:57
Joined
Jun 24, 2017
Messages
308
Hi All,

How can I fix the below error (Constant expression required)? As I want to get the value string column 1 from combobox.

Const error.PNG


Thanks in advance!
 
Interesting. You still use an A: drive? Do you, by any chance, have any missing references? Just curious...
 
Interesting. You still use an A: drive? Do you, by any chance, have any missing references? Just curious...

Thanks for your earliest response.
:) This is another project, also I must use a centralized shared folder for another purpose.
I have checked the References there is no missing.
 
Sorry it must be without the full path but I got a syntax error

Code:
Const strXFDF As String = " & Me.cboForm.Column(1) & ".xfdf"
 
Sorry it must be without the full path but I got a syntax error

Code:
Const strXFDF As String = " & Me.cboForm.Column(1) & ".xfdf"
What do you get with this?
Code:
Debug.Print Me.cboForm.Column(1)
 
Hmm, no, I mean, just enter that line by itself. Anyway, since you want to use a variable, you can't use a constant. So, try changing your code to this:
Rich (BB code):
'Declare the XFDF file to use
Dim strXFDF As String
strXFDF = Me.cboForm.Column(1) & ".xfdf"
Hope that helps...
 
Hmm, no, I mean, just enter that line by itself. Anyway, since you want to use a variable, you can't use a constant. So, try changing your code to this:
Rich (BB code):
'Declare the XFDF file to use
Dim strXFDF As String
strXFDF = Me.cboForm.Column(1) & ".xfdf"
Hope that helps...

It works fine with no error.

Thank you so much! :love:
 

Users who are viewing this thread

Back
Top Bottom