|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Problem updating date and time using ADO
I'm trying to record the date and time when the user press the "Enter" button into my database (access)
here my code: Code:
Private Sub tmrdate_Timer()
txtdate.Text = Format(Now, "dddd ,mmmm dd , yyyy")
txttime.Text = Format(Now, "hh:mm AM/PM")
End Sub
Private Sub cmdEnter_Click()
AdoAttendance.Recordset![Date] = txtdate.Text
AdoAttendance.Recordset![Time] = txttime.Text
AdoAttendance.Recordset.Update
End Sub
This program are able to display the date and time in the text box. But when i click on the "Enter" button, there is an error message occur state that, "Object variable or with block variable not set" Please help me. |
|
#2
|
||||
|
||||
|
Why are you formatting Now in a text box then using that to update the recordset ... Why not simply cut the BS and assign Now to the recordset directly?
How is AdoAttendance created? What's the scope? How is the recordset opened? This is where the problem is not with assigning the date specifically..,
__________________
medialint.com "Energy has the opportunity to change the climate if it's done right." - Sen. John Ensign, R-Nev. (quoted out of context) |
|
#3
|
||||
|
||||
|
Quote:
This is a very common error. Did you instantiate the recordset? Can you post the whole update sub? |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Problem updating date and time using ADO |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|