The following is a textbook exercise that I can not get to work. Working in Access 2000, split databases App = Swimreg; Data = Swimdata. I want to change the default value in the swimdata.tblClasses.Semester field to equal the Value in the txtSemesterID textbox.
Any ideas on why this doesn't work? (it actually removes the data in the default property but does not replace it.)
TIA,
Mike
Private Sub txtSemesterID_AfterUpdate()
'Update the default value of the Semester field
'in tblClasses
Dim cnnSwimData As ADODB.Connection
Dim tbl As ADOX.Table
Dim cat As New ADOX.Catalog
Set cnnSwimData = New ADODB.Connection
cnnSwimData.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Ch05\SwimData.mdb;"
Set cat.ActiveConnection = cnnSwimData
Set tbl = cat.Tables("tblClasses"
tbl.Columns("Semester".Properties("Default" = _
Chr(34) & Me![txtSemesterID] & Chr(34)
cnnSwimData.Close
End Sub
Any ideas on why this doesn't work? (it actually removes the data in the default property but does not replace it.)
TIA,
Mike
Private Sub txtSemesterID_AfterUpdate()
'Update the default value of the Semester field
'in tblClasses
Dim cnnSwimData As ADODB.Connection
Dim tbl As ADOX.Table
Dim cat As New ADOX.Catalog
Set cnnSwimData = New ADODB.Connection
cnnSwimData.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Ch05\SwimData.mdb;"
Set cat.ActiveConnection = cnnSwimData
Set tbl = cat.Tables("tblClasses"
tbl.Columns("Semester".Properties("Default" = _
Chr(34) & Me![txtSemesterID] & Chr(34)
cnnSwimData.Close
End Sub