Hello All,
Im pretty new to programming. I have a project using an access DB using forms generated with VBA. I ran into a problem that seems simple but I cant figure it out. What I am trying to do is add a record to the DB. Process that I am using to clear my controls is this
Private Sub ctrlClear()
Dim objctrl As Control
For Each objctrl In Me.Controls
If TypeOf objctrl Is TextBox Then
objctrl.SetFocus
objctrl.Text = ""
ElseIf TypeOf objctrl Is ComboBox Then
objctrl.SetFocus
objctrl.Text = ""
End If
Next objctrl
End Sub
it clears the controls but it also deletes the fields associated to the record I had just cleared in the DB.
I dont know what other information you may need. Im using the DAO 3.6 object library.
thanks in advance
Mychal
Im pretty new to programming. I have a project using an access DB using forms generated with VBA. I ran into a problem that seems simple but I cant figure it out. What I am trying to do is add a record to the DB. Process that I am using to clear my controls is this
Private Sub ctrlClear()
Dim objctrl As Control
For Each objctrl In Me.Controls
If TypeOf objctrl Is TextBox Then
objctrl.SetFocus
objctrl.Text = ""
ElseIf TypeOf objctrl Is ComboBox Then
objctrl.SetFocus
objctrl.Text = ""
End If
Next objctrl
End Sub
it clears the controls but it also deletes the fields associated to the record I had just cleared in the DB.
I dont know what other information you may need. Im using the DAO 3.6 object library.
thanks in advance
Mychal