Fields not responding

  • Thread starter Thread starter Gord
  • Start date Start date
G

Gord

Here is the portion of the code that is giving me grief. The query is
based on a single table.


If Me.chkRenter = -1 Then
Me.LineRenter.Visible = True
Me.lblRenter.Caption = "Renter:"
Me.chkRentSingle.Visible = True
Me.lblRentFname.Caption = RentFname '(field created before query
was built - works fine)
Me.lblRentPhone.Caption = "Phone Number:"
Me.lblRentPhoneNo.Caption = RentPhone '(field created after query
built - doesn't work)
If Me.chkRentSingle = 0 Then
Me.lblRentAnd.Caption = " and " & RSFname '(field
created after query was built - doesn't work)
Me.lblRentLname.Caption = RentLname '(field created before
query was built - works fine)
Else
Me.lblRentAnd.Caption = " " & RentLname
Me.lblRentLname.Caption = ""
End If

Else
Me.lblRenter.Caption = ""
Me.chkRentSingle.Visible = False
Me.lblRentFname.Caption = ""
Me.lblRentAnd.Caption = ""
Me.lblRentLname.Caption = ""
Me.LineRenter.Visible = False
Me.lblRentPhone.Caption = ""
Me.lblRentPhoneNo.Caption = ""

End If

I tried using the field in the form with a textbox as suggested and it works
fine. It looks like that is what I will end up doing, although I would
rather use a label because of the flexability in displaying text. Strange,
though, that the labels work for some fields and not for others.

Thanks again for your help
 
Gord,

I had a similar situation just the other day... I started with labels, and
had to go to form design view to assign captions (unlike VB studio, it does
not work in normal view in A2K). mI thought I could live with this - it
happens so fast that the user doesn't see it.
Then came the time to convert my application to .mde for distribution, and
realized my fundamental mistake: Design view not allowed in .mde! So I had
to go back to my forms and change labels to unbound text boxes (transparent,
enable>No, lock>Yes). It does the same job, and it's faster (no need to
switch views).
I swear, I'll never touch label captions programatically in Access again!

Nikos
 
Nikos,

Thank you for the info. That is interesting. However... I tried using an
unbound textbox as you suggested and I get exactly the same thing. The
second line in the following code gives me: < and > (the text in
perentheses) but not the variable <RSFname>. There are no complaints or
error messages from the program. RSFname returns a null value in the debug
window when I step through the code.

If Me.chkRentSingle = 0 Then
Me.txtRSFname.Value = " and " & RSFname
Me.lblRentLname.Caption = RentLname
Else
Me.txtRSFname.Value = " " & RentLname
Me.lblRentLname.Caption = ""
End If
 
Gord,

Your problem is obviously not in this piece of code; it is that RSFname is
not assigned a value where you expected it to. Debug around there, to find
why not.

Regards,
Nikos
 
Back
Top