Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Location
    Jerusalem, Israel
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Opening a related field (Access 2000)

    One of the forms in my database requires the user to type in information/instructions, sometimes up to a paragraph. Given that the form is a continuous form, the text area is small and it is sometimes difficult to use, even though there is a scroll bar. I decided to create a button that opens another form which is supposed to be just the text area of the form, but larger to make it easier to type. My problem is that when you click the button to zoom in, sometimes it "zooms" to the correct record and sometimes not. Here is my code (notes below):

    --------------

    Private Sub ZoomMode_Click()
    On Error GoTo Err_Zoom_Mode_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frm_Zoom Mode"


    stLinkCriteria = "[FileNumber]=" & "'" & Me![FileNumber] & "'"
    stLinkCriteria = "[Country]=" & "'" & Me![Country] & "'"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_ZoomMode_Click:
    Exit Sub

    Err_Zoom_Mode_Click:
    MsgBox Err.Description
    Resume Exit_ZoomMode_Click
    End Sub

    ----------

    Each file number has a country associated with it (like A1234 US). There could be an A1234 UK as well, but that would be a completely separate record. I therefore want the form to display the text box for the correct file number and country.

    Thanks for your help.

    Joe

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Opening a related field (Access 2000)

    Or, you could have the user hit [Shift-F2] to pop the zoom box. Or perhaps put this code in the double-click event of the field you want to show in the zoom box.

    RunCommand acCmdZoomBox
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Opening a related field (Access 2000)

    This line:

    stLinkCriteria = "[FileNumber]=" & "'" & Me![FileNumber] & "'"
    stLinkCriteria = "[Country]=" & "'" & Me![Country] & "'"

    Does not do what you want, because the second line completely replaces the value of stLinkCriteria from the first line with the one from the second.

    Try

    stLinkCriteria = "[FileNumber]=" & "'" & Me![FileNumber] & "'"
    stLinkCriteria = st LinkCriteria & " and [Country]=" & "'" & Me![Country] & "'"
    Regards
    John



  4. #4
    2 Star Lounger
    Join Date
    May 2002
    Location
    Jerusalem, Israel
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Opening a related field (Access 2000)

    Thanks for your suggestions.

    I ended up using the double-click version of the Shift F2 command - I had no idea it existed until now!

    Much appreciated,

    Joe

Posting Permissions

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