michellecole
Programmer
I'm working in VB6 with MS Access 2000.
I have a data repeater control that is displaying properly, but it is not updating the underlying table with new values entered by the user.
I built an ActiveX data repeater control, pubCtl.ctl, and saved it in a project called controlPrj.vbp. In a separate project, Billing_RemoteDeposit.vbp, I added a data repeater control, DataRepeater1, on a form called frmReviewBilling and set the RepeatedControlName to ControlPrj.pubCtl in the properties. I also added an Adodc and named it Adodc2. Adodc2 is the Data Source for DataRepeater1. Adodc2 uses an ODBC, the RecordSource = SELECT * FROM tblBillingWorkTable WHERE CustomerID = '& sSearchCustID &' ORDER BY tblBillingWorkTable.BILL_Level DESC , tblBillingWorkTable.AcctToCharge, tblBillingWorkTable.ServiceCode. The CommandType = adcmdText.
I had a tough time getting the proper records to display in DataRepeater1 initially because of the variable, sSearchCustID, in the recordsource which changes as the user advances through CustomerID records in a different Adodc called adodc1 which lives on the same form.
I'm assuming everything is wired up correctly since DataRepeater1 displays the correct data for each CustomerID record as the user scrolls through adodc1, so... why wouldn't the table be updated when the user updates a volume amount?
I set the RecordSource and DSN in the property pages of adodc2, but because the variable in the sql statement, sSearchCustID, is not known at startup - I set the RecordSource again and refresh the adodc at load and whenever the text box that displays the CustomerID of records from the first adodc changes:
Private Sub txtCustomerID_Change()
UpdateADODC2Properties
End Sub
Private Sub Form_Load()
UpdateADODC2Properties
End Sub
Private Sub UpdateADODC2Properties()
sSearchCustID = RTrim(LTrim(frmReviewBilling.txtCustomerID.Text))
Adodc2.ConnectionString = "DSN=RemoteDepositBilling;UID=sa;PWD= ;DSQ=RemoteDepositBilling"
Adodc2.RecordSource = "SELECT * FROM tblBillingWorkTable WHERE CustomerID = '" & sSearchCustID & "' ORDER BY tblBillingWorkTable.BILL_Level DESC , tblBillingWorkTable.AcctToCharge, tblBillingWorkTable.ServiceCode"
Adodc2.Refresh
End Sub
Here is my code for the pubCtl.ctl:
Private Sub txtVolumeAmt_Change()
PropertyChanged "volume"
End Sub
Public Property Get volume() As Double
volume = txtVolumeAmt
End Property
Public Property Let volume(ByVal newVolumeorCharge As Double)
txtVolumeAmt = newVolumeorCharge
End Property
Public Property Get cid() As String
cid = txtCustID
End Property
Public Property Let cid(ByVal newCustomerID As String)
txtCustID = newCustomerID
End Property
'**********************************************************
Any help with be most appreciated!
Thank you,
Michelle
I have a data repeater control that is displaying properly, but it is not updating the underlying table with new values entered by the user.
I built an ActiveX data repeater control, pubCtl.ctl, and saved it in a project called controlPrj.vbp. In a separate project, Billing_RemoteDeposit.vbp, I added a data repeater control, DataRepeater1, on a form called frmReviewBilling and set the RepeatedControlName to ControlPrj.pubCtl in the properties. I also added an Adodc and named it Adodc2. Adodc2 is the Data Source for DataRepeater1. Adodc2 uses an ODBC, the RecordSource = SELECT * FROM tblBillingWorkTable WHERE CustomerID = '& sSearchCustID &' ORDER BY tblBillingWorkTable.BILL_Level DESC , tblBillingWorkTable.AcctToCharge, tblBillingWorkTable.ServiceCode. The CommandType = adcmdText.
I had a tough time getting the proper records to display in DataRepeater1 initially because of the variable, sSearchCustID, in the recordsource which changes as the user advances through CustomerID records in a different Adodc called adodc1 which lives on the same form.
I'm assuming everything is wired up correctly since DataRepeater1 displays the correct data for each CustomerID record as the user scrolls through adodc1, so... why wouldn't the table be updated when the user updates a volume amount?
I set the RecordSource and DSN in the property pages of adodc2, but because the variable in the sql statement, sSearchCustID, is not known at startup - I set the RecordSource again and refresh the adodc at load and whenever the text box that displays the CustomerID of records from the first adodc changes:
Private Sub txtCustomerID_Change()
UpdateADODC2Properties
End Sub
Private Sub Form_Load()
UpdateADODC2Properties
End Sub
Private Sub UpdateADODC2Properties()
sSearchCustID = RTrim(LTrim(frmReviewBilling.txtCustomerID.Text))
Adodc2.ConnectionString = "DSN=RemoteDepositBilling;UID=sa;PWD= ;DSQ=RemoteDepositBilling"
Adodc2.RecordSource = "SELECT * FROM tblBillingWorkTable WHERE CustomerID = '" & sSearchCustID & "' ORDER BY tblBillingWorkTable.BILL_Level DESC , tblBillingWorkTable.AcctToCharge, tblBillingWorkTable.ServiceCode"
Adodc2.Refresh
End Sub
Here is my code for the pubCtl.ctl:
Private Sub txtVolumeAmt_Change()
PropertyChanged "volume"
End Sub
Public Property Get volume() As Double
volume = txtVolumeAmt
End Property
Public Property Let volume(ByVal newVolumeorCharge As Double)
txtVolumeAmt = newVolumeorCharge
End Property
Public Property Get cid() As String
cid = txtCustID
End Property
Public Property Let cid(ByVal newCustomerID As String)
txtCustID = newCustomerID
End Property
'**********************************************************
Any help with be most appreciated!
Thank you,
Michelle