Wil Newbie
Joined: 25 Aug 2005 Posts: 9
|
Posted: Aug 29th, 2005 09:01 PM Post subject: How to generate the report from the Adodc and Data Grid? |
|
|
Is there anyone can help me to generate report from a form with using Adodc to insert the data and use data grid to represent the output of inserting data.
| Code: |
Private Sub cmdSummit_Click()
response = MsgBox("Confirm to add new record?", vbYesNo)
If response = vbYes Then
Call callDatabase
With myset
.AddNew ' add new record
' you can write by this way and also by the following
' method
.Fields("ID").Value = txtItem.Text
!Type = txtType.Text
!Quantity = txtQuantity.Text
!DateOut = txtDate.Text
!Requirement = txtRequirement.Text
!Room = txtRoom.Text
If .Fields("Room").Value = txtRoom.Text Then
.Update ' after add in update the database
txtItem.Text = ""
txtType.Text = ""
txtQuantity.Text = ""
txtDate.Text = ""
txtRequirement.Text = ""
Index = txtRoom.Text
txtRoom.Text = ""
frmPurchaseForm.Refresh
frmInterface.cmdRoom(Index).Enabled = True
frmInterface.Refresh
MsgBox "Item's Data Stored."
End If
.Requery
End With
Else
MsgBox "Operation cancelled", vbCritical
txtItem.Text = ""
txtType.Text = ""
txtQuantity.Text = ""
txtDate.Text = ""
txtRequirement.Text = ""
txtRoom.Text = ""
End If
End Sub
Above is show about the code for me to insert the data into the database name CustomerOrder.Then the frmInterface will alocated with a number of button with name cmdRoom(Index).After insert the data with a room number then the cmdRoom(Index) will be enabled it and which can be click it and a form will display with using the data grid control.Then, now the problem is i need to generate the report from that data grid and is there any way to help me to settle with it.Thanks... |
|
|