syntax or expression to access checkbox status

  • Thread starter Thread starter mrbeepa
  • Start date Start date
M

mrbeepa

I am not familiar with the syntax of VB though I do have a fair knowledge of
several programming languages. I am working on a form in access 2007 where
the user enters address information and can click a check box if the billing
address is the same address, if it is I want the form to fillin in the billin
address text boxes with the same info as the user has already entered. I have
seen posts using something like this.

If Me.mycheckboxname < someVariable Then do such and such. So I am trying
this in the VB code section.
If Me.mycheckboxname == True Then bFname = cFname bLastName = cLastName
and etc

and it does not like this code. Can someone head me down the right path here?
Would sure appreciate it. :)
 
mrbeepa said:
I am not familiar with the syntax of VB though I do have a fair knowledge
of
several programming languages. I am working on a form in access 2007 where
the user enters address information and can click a check box if the
billing
address is the same address, if it is I want the form to fillin in the
billin
address text boxes with the same info as the user has already entered. I
have
seen posts using something like this.

If Me.mycheckboxname < someVariable Then do such and such. So I am trying
this in the VB code section.
If Me.mycheckboxname == True Then bFname = cFname bLastName = cLastName
and etc

and it does not like this code. Can someone head me down the right path
here?
Would sure appreciate it. :)


If Me.mycheckboxname = True Then
bFname = cFname
bLastName = cLastName
' ... etc.
End If

*OR*

If (Me.mycheckboxname) Then
bFname = cFname
bLastName = cLastName
' ... etc.
End If

It's also legal to leave out the parentheses and say

If Me.mycheckboxname Then

but there was a bug in some earlier versions of Access that caused a
dangling object pointer when you did that, so I just don't do it any more.
 
Thank you Dirk I have really been struggling with syntax. Your example is
very much appreciated!
 
Back
Top