
February 22nd, 2004, 10:01 AM
|
|
Registered User
|
|
Join Date: Feb 2004
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
a bit of a problem
Hey, hope you can help me with this. I'm running visual basic 6 connected to access 2000. I have two labels on a form which i need to have time and date entered into automatically when the user opens the form. Once the user has entered the other data required they click the submit button to make a new record using this data. The problem i'm having is getting the time and date to be entered into the two labels and then added to the record. This is the code i have so far:
Private Sub CmdSubmit_Click()
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
App.Path & "\Tables.mdb"
Set cnDB = New ADODB.Connection
cnDB.ConnectionString = strConnection
cnDB.Open
cnDB.Execute ("INSERT INTO Jobs([SchoolName], [Taken by], [Received Time], [Received Date]) VALUES('" & SelectSchoolCombo & "', '" & TakenTxt & "', '" & TimeTakenlbl & "', '" & DateTakenlbl & "');")
cnDB.Close
Any help will be much appreciated
- NervousH
|