IF Then Statement

  • Thread starter Thread starter Confused
  • Start date Start date
C

Confused

How do I make a command button do the following?

IF Combo1 is not null Then make [version] = the value in Combo1. And Make
[version] = [old version]. Finally set Combo1 to Null.
 
It *sounds* like you're saying you want to make [version]
equal to Combo1 then change it back to what it was before
making it equal to Combo1, then make Combo1 Null?

I'm struggling to see the point of all this, but if that's the case
and assuming Combo1 and [version] are text data type;

Private Sub cmdMyButton_Click ()

Dim strTemp As String

If Not IsNull(Me!Combo1) Then
strTemp = Me![version]
Me![version] = Me!Combo1
Me![version] = strTemp
Me!Combo1 = Null
End If

End Sub

???????
 
Confused said:
How do I make a command button do the following?

IF Combo1 is not null Then make [version] = the value in Combo1. And
Make
[version] = [old version]. Finally set Combo1 to Null.


Do you mean "make [old version] = [version]"? Because I don't see how you
can "make [version] = the value in Combo1. And Make [version] = [old
version]."

If you mean what I think, your code would look something like this:

If Not IsNull(Me!Combo1) Then
Me![old version] = Me!version
Me!version = Me!Combo1
Me!Combo1 = Null
End If
 
Back
Top