|
-
Changing Datafield at RunTime
I have a connection to a MS Access database through a DataEnvironment using
MS Jet 4.0. I have a form that has patient information and a tabstrip to
select which insurance info is shown. The insurance info is just about 4
fields that are all in the same table (i.e. Ins1, Ins1WkAuth...). I have
the following code to change the Fields at runtime:
Private Sub tsIns_Click()
If tsIns.SelectedItem = "Tertiary" Then
deTracker.rstbPatients.Update
txtMR.DataField = "MRNum3"
cmbIns.DataField = "Ins3"
txtHrsWk.DataField = "Ins3WkAuth"
txtHrsMn.DataField = "Ins3MnAuth"
ElseIf tsIns.SelectedItem = "Secondary" Then
deTracker.rstbPatients.Update
txtMR.DataField = "MRNum2"
cmbIns.DataField = "Ins2"
txtHrsWk.DataField = "Ins2WkAuth"
txtHrsMn.DataField = "Ins2MnAuth"
ElseIf tsIns.SelectedItem = "Primary" Then
deTracker.rstbPatients.Update
txtMR.DataField = "MRNum1"
cmbIns.DataField = "Ins1"
txtHrsWk.DataField = "Ins1WkAuth"
txtHrsMn.DataField = "Ins1MnAuth"
End If
End Sub
Only when I click the tab strip and the fields start to change it gives me
a databinding error that the new field is not updatable and then throws the
'Object required' run time error. How can I change the datafields at runtime???
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks