Results 1 to 4 of 4
  1. #1
    MelonFuel is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    28

    How do i get the value from a comboxbox and link it to print.

    Hi


    Im in a spot of bother.


    What i need to be able to do is write vba to find the value inside the comboxbox and then either:-


    1. Run a macro with the same value that is in the combobox


    Or




    2. Run a set of reports and print them off but are linked to the combobox value.


    The combobox name is ODTyper
    The combobox control source is ODType which is a field in TblType
    The combobox row source is SELECT [TblType].Model FROM TblType;
    The value inside the combobox are in the format of TE4700
    The name of the macros are in the format of TE4700
    The Main form is called FrmOrderDatabase.


    Plus somehow i need to get the value of the combobox and link it to print off the correct reports.


    Thanks MelonFuel

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    1. The combobox value is the macro name or a parameter used by macro? Why not just use VBA to do what the macro does?
    DoCmd.RunMacro ......

    2. Try:
    DoCmd.OpenReport "reportName", , , "ODType='" & Me.ODTyper & "'"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    MelonFuel is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    28
    Hi June7

    This is the code i have now.

    Code:

    If NZ(Me.ODTyper,"") <>"" then DoCmd.RunMacro Me.ODTyper
    But it gives me this parameter on every report if there a way to remove it.

    Click image for larger version. 

Name:	error parameter.PNG 
Views:	5 
Size:	7.3 KB 
ID:	9108

    Thanks MelonFuel

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    The macro opens reports?

    One of the reports or the query it has for a RecordSource or maybe in the macro, something called TblQueue.ODWonNo is referenced and Access can't find this entity. You will have to track it down and fix the reference.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Print & Print Preview Differ
    By IDH in forum Reports
    Replies: 3
    Last Post: 07-25-2012, 09:50 AM
  2. Replies: 5
    Last Post: 10-26-2011, 02:59 PM
  3. Replies: 0
    Last Post: 02-22-2011, 05:04 AM
  4. Print Preview different from Print Hardcopy
    By peterc in forum Reports
    Replies: 4
    Last Post: 10-27-2009, 05:35 AM
  5. Error when trying to print or print preview
    By TriAdX in forum Reports
    Replies: 8
    Last Post: 08-25-2009, 08:20 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