Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2003
    Posts
    225

    Unanswered: Option boxes - Making items visible

    i want the user to make a selection from one of two option boxes, with the choice that they make i want a list box to appear straight away, depending on there selection, can anyone help please.

    Cheers

    Andy
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I can't download an external file here, but the generic code is pretty basic. Just put "YourObject.visible = true" in the onclick event for your optionbox.

    So you would have:
    Code:
    If YourOption.value = "some value" Then
       FirstObject.visible = True
       SecondObject.Visible = False
    Else
       FirstObject.visible = False
       SecondObject.Visible = True
    End If
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Mar 2003
    Posts
    225
    ok great i have that working, not sure if i should start a new thread for this now or just keep this one going ? (Please Advise)

    i now need the user to make a coice from one of the visible list boxes, the trouble is i am not sure how this will work:

    if you select the total time option the approprite box becomes visible...if you then highlight one of the choices... then choose the other option box and highlight one of the choices (the user may have changes their mind which report to run.

    if you then select the first option box again the selection remains highlighted from the previous choice...

    will this effect anything when running my query.

    how do i program the form to run the chosen query ?

    is there some useful code floating around to open my query or should i use a macro ?

    i have attached my db for you to see...

    i hope this makes sense

    Please help me
    Attached Files Attached Files

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Lots of "if" statements my friend
    That's the stuff we get paid for. Tedium.

    Actually write out a flow-chart of what happens when each box is checked. Or if you're already comfortable with complex switches, just write a bunch of nexted if statements
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Mar 2003
    Posts
    225
    i have been working on this project all week and now it is almost ready to use i am having problems after saving the file to a previous version..

    it was designed in Access 2K and it worked fine i need this in access 97, so i saved it as a prior version of Access and opened it and debugged it and saved the modules, but now when i run it i get a message appear saying,

    The action or method requires a query name argument

    you tried to open the use openquery action or method, but you left the name argument blank, in the query name argument, enter a query name.


    what is this meaning please ? my code is below and i have attached my db

    Please Help

    Code:
    Option Compare Database
    Option Explicit
    
    
    Private Sub DisplaySection_AfterUpdate()
        Select Case DisplaySection
            Case 1
                Me.ByMachine.Visible = True
                Me.ByEventcode.Visible = False
            Case 2
                Me.ByEventcode.Visible = True
                Me.ByMachine.Visible = False
        End Select
    End Sub
    Private Sub cmdRunQuery_Click()
        On Error GoTo Err_cmdRunQuery_Click
        DoCmd.SetWarnings False
        DoCmd.OpenQuery ("qEventcodeanalysis")
        DoCmd.SetWarnings True
        Select Case Me.DisplaySection
            Case 1
                DoCmd.OpenQuery Me.ByMachine.Column(1), , acReadOnly
            Case 2
                DoCmd.OpenQuery Me.ByEventcode.Column(1), , acReadOnly
        End Select
    Exit_cmdRunQuery_Click:
        Exit Sub
    
    Err_cmdRunQuery_Click:
        MsgBox Err.Description
        Resume Exit_cmdRunQuery_Click
    End Sub
    
    Private Sub DisplaySection_Enter()
        If (Len(cboDaycodeStart & vbNullString) = 0) Or (Len(cboDaycodeEnd & vbNullString) = 0) Or (Len(Line & vbNullString) = 0) Then
            If (Len(cboDaycodeStart & vbNullString) = 0) Or (Len(cboDaycodeEnd & vbNullString) = 0) Then
                MsgBox "Please enter start and end Daycodes"
                If (Len(cboDaycodeStart & vbNullString) = 0) Then
                    Me.cboDaycodeStart.SetFocus
                    Exit Sub
                ElseIf (Len(cboDaycodeEnd & vbNullString) = 0) Then
                    Me.cboDaycodeEnd.SetFocus
                    Exit Sub
                End If
            End If
            If Len(Line & vbNullString) = 0 Then
                MsgBox "Please select a line"
                Me.Line.SetFocus
            End If
        End If
    End Sub
    
    
    Private Sub cmdClose_Click()
        On Error GoTo Err_cmdClose_Click
    
    
        DoCmd.Close
    
    Exit_cmdClose_Click:
        Exit Sub
    
    Err_cmdClose_Click:
        MsgBox Err.Description
        Resume Exit_cmdClose_Click
    
    End Sub
    Attached Files Attached Files

Posting Permissions

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