 |
|
 |
seem Level: Graduate
 Registered: 28-11-2005 Posts: 12
|
Display data on access form
Hi all,
please help me with my problem.
i'm using a parameter query wretten in VB as in the attachement, this is done in Microsoft access but my problem is i don't know how to link the resultd data from the query with a form in Microsoft access.
Thanx is advance...
Seem
----------------------------------------------------------------------
Private Sub Combo41_AfterUpdate()
Dim cmd1 As Command
Dim rs1 As Recordset, str1 As String
Dim fldLoop As ADODB.Field
Dim prm1 As ADODB.Parameter, int1 As Integer
Dim frm1 As Form
Dim i As Integer
'Form_PurchaseOrder.RecordSource = "TOP"
Set cmd1 = New ADODB.Command
With cmd1
.ActiveConnection = CurrentProject.Connection
.CommandText = "Parameters [POnum] Long;" & _
"SELECT PurchaseOrder.Description, PurchaseOrder.COdate, " & _
"PurchaseOrderDetails.totalPrice, [value1]*[totalPrice]/100 AS v1, " & _
"[value2]*[totalPrice]/100 AS v2, [value3]*[totalPrice]/100 AS v3, " & _
"[value4]*[totalPrice]/100 AS v4, [value5]*[totalPrice]/100 AS v5, " & _
"PurchaseOrder.POstatus, PurchaseOrder.POnum, TermsOfPayment.TermsOfPay " & _
"FROM (PurchaseOrder INNER JOIN PurchaseOrderDetails ON " & _
"PurchaseOrder.POnum = PurchaseOrderDetails.POnum) INNER JOIN " & _
"TermsOfPayment ON PurchaseOrder.termsOfPay = TermsOfPayment.TermsOfPay " & _
"WHERE (((PurchaseOrder.POnum) = [POnum]))"
.CommandType = adCmdText
End With
Set prm1 = cmd1.CreateParameter("[POnum]", adInteger, adParamInput)
cmd1.Parameters.Append prm1
prm1.Value = Form_PurchaseOrder.POnum.Value
cmd1.Execute
end sub
-----------------------------------------------------------------------
____________________________
Seem Haroun
|
|
12-12-2005 at 12:38 PM |
|
|
seem Level: Graduate
 Registered: 28-11-2005 Posts: 12
|
Re: Display data on access form
hi its me again...
thank u really for ur help.
i tried the strSQL solution but nothing apeared in the form am i doing something wrong? or do i need to do something i'm not aware of?
thanx again
____________________________
Seem Haroun
|
|
20-12-2005 at 01:13 PM |
|
|
|
|
 |
 |