On Current Value List Expression Not Working

T

Tal

I have the following code in the OnCurrent event of my form.
It is returning nothing, though I do not get any error messages either, just
a very empty combo box.
Help much appreciated.
Cheers,
Tal


Private Sub Form_Current()
Dim strRowSource As String

If IsNull(Me.txtClientLastName) = False Then
strRowSource = strRowSource & Me.txtClientFirstName & " " &
Me.txtClientLastName & ";"
If IsNull(Me.txtClientCompanyOnly) = False Then
strRowSource = strRowSource & Me.txtClientCompanyOnly & ";"
If IsNull(Me.txtClientSpouseFirstName) = False Then
strRowSource = strRowSource & Me.txtClientSpouseFirstName & " " &
Me.txtClientLastName & ";"
strRowSource = strRowSource & Me.txtClientFirstName & " or " &
Me.txtClientSpouseFirstName & " " & Me.txtClientLastName & ";"
If IsNull(Me.txtClientSpouseLastName) = False Then
strRowSource = strRowSource & Me.txtClientSpouseFirstName & " " &
Me.txtClientSpouseLastName & ";"
End If

If Len(strRowSource) > 0 Then
strRowSource = Left$(strRowSource, Len(strRowSource) - 1)
Me.keyReceiptTo.RowSourceType = "Value List"
Me.keyReceiptTo.RowSource = strRowSource
Else
Me.keyReceiptTo.RowSourceType = ""
Me.keyReceiptTo.RowSource = ""
End If
End Sub
 
T

Tal

Perfect fantastic. You are a star!!!!!
I guess it was the Option Explicit thing cause I had already caught the End
If thing. What does Option Explicit mean anyway?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top