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.
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.
how is this then? I added the namesHPOHD.TXTHPODT.TXTVisual FoxPro.pdf
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)
Once you select a value, this code in the afterUpdate event of combo11 is executedCode:SELECT XXX.OrderNumber FROM kjOrder AS XXX;
The key here is that you can select the Order to display along with the OrderDetails.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
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.
Thanks much. I will work on this and let you know. I really appreciate your time.
In your earlier posts you called that table dbo_HPOHD
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
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?
I will try again with a new database/ I believe I understand the code now. THanks.
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?
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.
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.
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?
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.