Nick, Got Column(1) working great , but having trouble with Column(8), I
have commered it out for the moment
Thanks for any Help.Bob
Private Sub cmdLastPay_Click()
If cbOwnerName.Column(1) = "" Or IsNull(cbOwnerName.Column(1)) Then
MsgBox "Please Make a Selection!", vbApplicationModal + vbOKOnly +
vbInformation
Exit Sub
'If cbOwnerName.Column(8) = "" Or IsNull(cbOwnerName.Column(8)) Then
'MsgBox "No Last Payment!", vbApplicationModal + vbOKOnly +
vbInformation
'Exit Sub
End If
Dim X As String
X = Me.cbOwnerName.Column(8)
Me.tbDateFrom = X
'End If
End Sub
Bob V said:
Nick, Can I put an error Message In if no selection is made
If cbOwnerName.value = "" Or IsNull(cbOwnerName.value) Then
MsgBox "You have not made a Selection!", vbApplicationModal +
vbOKOnly + vbInformation
Exit Sub
Dim x as string
x = me.cbOwnerName.Column(8)
me.tbStartDate = x
End Sub
Thanks for your Help...Bob
Biz Enhancer said:
Hi Bob,
The Dim Statement is simply declaring that variable "x" is a string. The
"x"
can be replaced with anything as long as later in the code the reference
is
to the variable. e.g.
Dim banana as integer
banana = 5
Declaring variables is a really powerful way to reuse code and to
minimise
the amount of coding when in a loop statement (among other things).
Once I started to understand them my coding ability really started to
take
off.
Glad to have been some use.
Regards,
Nick.
:
Biz How Brilliant is that Thanks going to find out how to learn to code
Dim
x..................Thanks Bob
Hi Bob,
If I am understanding correctly this should solve your problem.
"OnClick" event
Sub Command1_Click()
Dim x as string
x = me.cbOwnerName.Column(8)
me.tbStartDate = x
End Sub
HTH,
Nick
:
My Combo Box [cbOwnerName] has a Row Source [qPayableTotalForPayment]
which
has 9 Columns in combo box the last Column being
[My Date]MyDate: Format([MaxOfBillDate],"d-mmm-yy")
I want to code my Button to Change the date in [tbStartDate] to the
date
im
[cbOwnerName] once selected I click Button to give that date in
[tbStartDate]
Thanks for any help.........Bob