bdpitta
MIS
- Nov 7, 2002
- 49
I have a button on one of my forms that sets the defualt value for a column in one of my tables. Here is the code:
Private Sub Command3_Click()
Dim con As ADODB.Connection
Dim sql As String
Set con = CurrentProject.Connection
sql = "ALTER TABLE BadDebts
ALTER COLUMN DateReserved SET DEFAULT 1/1/2000"
With con
.Execute sql
.Close
End With
Set con = Nothing
End Sub
This code works just fine, but what I would like to do is to enable the user to enter a default date of their choosing. How can I alter this code (or write something completely different) that would allow for the user to enter a date to be used in the alter table statement? (perhaps with a textbox or inputbox..)?
Thankyou
Private Sub Command3_Click()
Dim con As ADODB.Connection
Dim sql As String
Set con = CurrentProject.Connection
sql = "ALTER TABLE BadDebts
ALTER COLUMN DateReserved SET DEFAULT 1/1/2000"
With con
.Execute sql
.Close
End With
Set con = Nothing
End Sub
This code works just fine, but what I would like to do is to enable the user to enter a default date of their choosing. How can I alter this code (or write something completely different) that would allow for the user to enter a date to be used in the alter table statement? (perhaps with a textbox or inputbox..)?
Thankyou