Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2003
    Location
    Harrow, UK
    Posts
    53

    Question Unanswered: Selecting different pictures in a form

    I have a table which (amongst other things) has three fields called [Figure 1], [Figure 2] and [Figure 3].

    I have a form which includes a Bound Object Frame called [FigureFrame]. Below this frame I have a command button.

    By default the [FigureFrame] displays [Figure 1].

    What I want, is to press the button and have [FigureFrame] display [Figure 2], press it again and display [Figure 3] and press it again and display [Figure 1] again.

    .....and I cannot figure it out at all...

    Does anyone have any ideas - but please nothing too complicated - I'm no guru.

    Thank you
    Thank you,
    James

  2. #2
    Join Date
    Jul 2003
    Location
    Harrow, UK
    Posts
    53

    This is how far I've got ....

    Thought I'd post what I'd accomplished so far :

    Private Sub CommandNextFigure_Click()
    On Error GoTo Err_CommandNextFigure_Click
    If Me.FigureFrame.ControlSource = [Figure 1] Then
    Me.FigureFrame.ControlSource = [Figure 2]
    ElseIf Me.FigureFrame.ControlSource = [Figure 2] Then
    Me.FigureFrame.ControlSource = [Figure 3]
    Else
    Me.FigureFrame.ControlSource = [Figure 1]
    End If

    Exit_CommandNextFigure_Click:
    Exit Sub

    Err_CommandNextFigure_Click:
    MsgBox Err.Description
    Resume Exit_CommandNextFigure_Click

    End Sub

    However when I click the button I get the Run-Time error "An expression can't be longer than 2,048 characters".
    Thank you,
    James

  3. #3
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    this works

    Private Sub Command1_Click()
    If Me.Box.ControlSource = "Figure1" Then
    Me.Box.ControlSource = "Figure2"
    ElseIf Me.Box.ControlSource = "Figure2" Then
    Me.Box.ControlSource = "Figure3"
    Else
    Me.Box.ControlSource = "Figure1"
    End If
    Me.Refresh
    End Sub
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  4. #4
    Join Date
    Jul 2003
    Location
    Harrow, UK
    Posts
    53

    Wow...I was very nearly there

    ...so I just needed to use " " instead of [ ].

    Thanks for your help, that works great.
    Thank you,
    James

  5. #5
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    NP, glad to help
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

Posting Permissions

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