Page 3 of 4 FirstFirst 1234 LastLast
Results 31 to 45 of 53
  1. #31
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,728
    no field names??


    Would like field names as first row in the csv in order to import into my tables.
    Perhaps the demo database approach where you import these 2 tables would be quicker.

  2. #32
    kdtrimble is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2015
    Posts
    41
    how is this then? I added the namesHPOHD.TXTHPODT.TXTVisual FoxPro.pdf

  3. #33
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,728
    I have created a small demo based on some tables that I had.

    There are 3 tables
    kjOrder ............................ an order table (header type info)
    kjOrderPartDetail ............... line items for an Order (detail info for order)
    kjPart................................ parts table (parts that could be ordered)

    2 Forms (well 1 form and 1 subform)
    kjOrderF ............................Form (showing Order)
    kjOrderPartDetail subform..... subform showing the line items for an Order.


    To demo your issue I added a combobox called combo11 to the header area of form kjOrderF.

    The purpose of the combo is to allow you to select an Order from all Orders in kjOrder

    This is the rowsource of combo11 (the data for selection)
    Code:
    SELECT XXX.OrderNumber FROM kjOrder AS XXX;
    Once you select a value, this code in the afterUpdate event of combo11 is executed

    Code:
    '
    '
    Private Sub Combo11_AfterUpdate()
        Dim myFilter As String
    10  Debug.Print "MyFilter is " & myFilter
        '
        ' Line 20 tells Access to use the selection in Combo11
        'to identify the single record of interest (to be printed)
        '
        'The debug.print lines are for debugging
    20  myFilter = "OrderNumber ='" & Me!Combo11 & "'"  'which Order to show
    30  Debug.Print "MyFilter is " & myFilter
    40  Me.Filter = myFilter   'this is the filter to use
    50  FilterOn = True          'make the filter active
    60  Me.Requery               'requery Access to invoke the Filter
    
    End Sub
    The key here is that you can select the Order to display along with the OrderDetails.
    In your case you would Print the Order and details. The concept is to filter the the recordset to be displayed/printed.

    I hope this helps with your printing issue.

    Good luck.
    Attached Files Attached Files

  4. #34
    kdtrimble is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2015
    Posts
    41
    Thanks much. I will work on this and let you know. I really appreciate your time.

  5. #35
    kdtrimble is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2015
    Posts
    41
    Do you see something wrong in this? SELECT HPOHD.* AS Expr1 FROM HPOHD;

    Click image for larger version. 

Name:	Screenshot 2015-05-13 10.16.40.png 
Views:	7 
Size:	16.0 KB 
ID:	20677

  6. #36
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,728

  7. #37
    kdtrimble is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2015
    Posts
    41
    Right! THanks. Now I get a data type mismatch error with line 40 highlighted. I am using the same combo box name as you.

    Private Sub Combo11_AfterUpdate()
    Dim myFilter As String
    10 Debug.Print "MyFilter is " & myFilter
    '
    ' Line 20 tells Access to use the selection in Combo11
    'to identify the single record of interest (to be printed)
    '
    'The debug.print lines are for debugging
    20 myFilter = "HHPO ='" & Me!Combo11 & "'" 'which Order to show
    30 Debug.Print "MyFilter is " & myFilter
    40 Me.Filter = myFilter 'this is the filter to use
    50 FilterOn = True 'make the filter active
    60 Me.Requery 'requery Access to invoke the Filter

    End Sub

  8. #38
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,728
    Did you use a separate database to do your testing?
    If you did,can you post the database here in the forum?

    Try step debugging and look at the locals window or use more debug.print statements to show values of controls/variables.

    Did you understand the database and code I posted?

  9. #39
    kdtrimble is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2015
    Posts
    41
    I will try again with a new database/ I believe I understand the code now. THanks.

  10. #40
    kdtrimble is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2015
    Posts
    41
    Did I do this correctly?

    I want to select the PO from the combo box and after I select it I want it to print that record only. I also would li8ke the ComboBox order to be large to small.

    Did I upload the files correctly?
    Attached Files Attached Files

  11. #41
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,728
    I have downloaded your file.
    I have made a new report called report1. I could not get your report to open, Access kept telling me there was an incomplete query??? I have no idea what was causing it but I did see you had a space in your report name, and a different report name with the vba. I tried renaming your report to XXX, but it would not open.
    So I built the new report.
    I modified the rowsource of the combo11 in order to get it displaying high to low.

    If you open your frm Form1, and select a PO number from the combo, it will trigger the after update event (which I have modified ) and create a "where clause" (filter) and then open Report1 with the selected PONUm.

    I have attached your database with the new report and adjustments.
    Good luck.
    Attached Files Attached Files

  12. #42
    kdtrimble is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2015
    Posts
    41
    Yes, I can work with this! Thanks. I will study it and then move the principle to the real database. I will let you know how I do. Thanks again for all of your help. If I have any questions I will let you know.

  13. #43
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,728

  14. #44
    kdtrimble is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2015
    Posts
    41
    I am ALMOST there! Apparently I have some old code left somewhere that is referencing HDPO. I am only using HHPO. I opened up the accdb file in NotePad and found HDPO in there but don't know where. It comes up when I run the form. I have attached the screenshot . Any idea where to look?
    Attached Thumbnails Attached Thumbnails Screenshot 2015-05-15 09.31.01.png  

  15. #45
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,728
    You shouldn't have to open with Notepad.
    What were you doing when that screen popped up?
    It's probably associated with a query?
    You should be able to find it from within Access --especially if you can narrow things down and use step debugging.

Page 3 of 4 FirstFirst 1234 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 02-21-2015, 11:35 PM
  2. Replies: 2
    Last Post: 02-07-2015, 04:30 PM
  3. Replies: 14
    Last Post: 01-08-2015, 04:50 PM
  4. Print single label
    By Voodeux2014 in forum Access
    Replies: 2
    Last Post: 11-12-2014, 01:52 PM
  5. Print Label when certian condition is met.
    By talktime in forum Reports
    Replies: 3
    Last Post: 12-15-2012, 03:26 AM

Tags for this Thread

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