Results 1 to 5 of 5
  1. #1
    Tari is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    36

    Eventprocedure to work with switchboard

    Hi,



    I have a button on one of my forms that runs the following event procedure:

    Private Sub cmdAltOrder_Click()
    Dim altorder As String
    Dim numaltorder As Long
    altorder = InputBox("Enter the order number for which you want a summary", "Enter Order Number")
    If IsNumeric(altorder) Then
    numaltorder = CLng(altorder)
    If DCount("*", "[order details]", "[RTP number]=" & numaltorder) > 0 Then
    DoCmd.OpenReport "Orders Summary", acViewPreview, , "[OrderID]=" & numaltorder
    Else
    MsgBox "No summary is available for the order number you entered"
    End If
    Else
    MsgBox "Value entered is not a number"
    End If
    End Sub

    I would like to make that work from the switchboard. I have to create a macro to do the event procedure above, but unfortunately I don't know macros -.-

    Would somebody give me a hand?

    Thanks!

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Why do you 'have to' create a Macro for this?

  3. #3
    Tari is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    36
    Quote Originally Posted by Robeen View Post
    Why do you 'have to' create a Macro for this?
    I don't have to have to.. if you can show me another way to do it, happy to learn

  4. #4
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    You said:
    I have to create a macro to do the event procedure above
    . . . that's why I asked why you had to.

    Can you not add a button to your switchboard and then put the code into that button?

  5. #5
    Tari is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2011
    Posts
    36
    Quote Originally Posted by Robeen View Post
    You said:
    Can you not add a button to your switchboard and then put the code into that button?
    *sigh* of course..

    I used the switch board manager to create the switchboard and it only gave you a few limited options and what the switchboard item can do. I created a button with the wizard and came to the same limitations.

    I was not thinking that I could create an entry with the switchboard manager and then go into design view and put my code behind it -.-

    Maybe I should go have some more coffee..

    thanks for the nudge Robeen

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 09-13-2011, 01:38 PM
  2. switchboard like
    By nkuebelbeck in forum Access
    Replies: 1
    Last Post: 06-24-2011, 04:03 PM
  3. Switchboard help? Please
    By MrT1993 in forum Access
    Replies: 13
    Last Post: 02-13-2011, 01:15 PM
  4. Switchboard
    By mwabbe in forum Access
    Replies: 4
    Last Post: 08-26-2010, 07:17 AM
  5. Switchboard Help
    By Danzivar in forum Access
    Replies: 1
    Last Post: 12-15-2006, 03:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums