Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2005

    Unanswered: Help with visibility control based on VB statement

    I pretty much have this nailed down, but I want to improve it. Basically, I want a textbox to appear based on a criteria that is in another box (I used a simple VB IF statement). Right now I have it so that it "checks" the statement only if yuo leave the record and scroll back (Using "Current" trigger under Form). Is there a way to have it "check" the statement immediately, like if I were to make a change to the record that would prove the statement to be true? I've experimented with the MouseOver and Click statements, which have worked but I don't want my users to have to do something like that when they don't have to...I'd like for it to be instantaneous for them.

    Here's my VB code if it helps (Form-Current)
    Private Sub Form_Current()
    Rate.Visible = False
    If State = "NJ" Then
    Rate.Visible = True
    Rate.Visible = False
    End If
    End Sub

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    if your code works ok when you navigate through the recordset then place it in a function, call that function from the forms on current event and from the relevant control(s) on change event and possibly on lost focus events

    If you are unsure of which events to use then I'd suggest as a one off exrcise you place a msgbox in each event for a form and control type with a message to identify the event that has been triggered so you can see what happens when. bear in mind that not all events fire or fire in the sequence that you'd expect - some (minor) events get "lost in the post"


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts