S
shmoussa
Okay I hope someone can help. I have a form with an import button.
Clicking this button opens up another form which allows the user to
type in any date and then click the continue button which continues
the import process. The .CSV file that is being imported has four
fields. The table that the data is being imported to has five fields.
The field that remains empty in the table is called DATE. Can someone
tell me how to fill the 200+ empty DATE fields using the date the user
types in?
Hopeful outcome: User clicks import enters 05/27/2007 in the date
field and clicks import. If the user does not type a date in, a
message box should inform the user and stop the import process.
Otherwise, 350 records are added to a table called DISKS. The DATE
field for each of the 350 records is filled in with 05/27/2007. Can
anyone give me the code to add to my already existing code? (My
importing code)
I'd appreciate it
********************************CODE
START***************************************
Private Sub Command3_Click()
On Error GoTo err_Command3_Click
Dim strFile As String
Dim str As String
strFile = GetOpenFile_CLT("C:\Disk Space", "Select the .csv file
that you want to import")
If strFile = "" Then
Exit Sub
Else
If MsgBox("Add the following file to your data: " & strFile, vbYesNo,
"Confirm the file is correct:") = vbNo Then
Exit Sub
Else
End If
End If
DoCmd.TransferText acImportDelim, "DISKS", "TableNew", strFile, True
****(I imagine the code is added here to copy the data in TextBox1 to
the Date field in the Disks Table)**********
exit_Command3_Click:
Exit Sub
err_Command3_Click:
MsgBox Err.Number & " " & Err.Description
Resume exit_cmdOpenFile_Click
End Sub
End Sub
**********************************************************************
Any help is appreciated. Thanks.
Clicking this button opens up another form which allows the user to
type in any date and then click the continue button which continues
the import process. The .CSV file that is being imported has four
fields. The table that the data is being imported to has five fields.
The field that remains empty in the table is called DATE. Can someone
tell me how to fill the 200+ empty DATE fields using the date the user
types in?
Hopeful outcome: User clicks import enters 05/27/2007 in the date
field and clicks import. If the user does not type a date in, a
message box should inform the user and stop the import process.
Otherwise, 350 records are added to a table called DISKS. The DATE
field for each of the 350 records is filled in with 05/27/2007. Can
anyone give me the code to add to my already existing code? (My
importing code)
I'd appreciate it
********************************CODE
START***************************************
Private Sub Command3_Click()
On Error GoTo err_Command3_Click
Dim strFile As String
Dim str As String
strFile = GetOpenFile_CLT("C:\Disk Space", "Select the .csv file
that you want to import")
If strFile = "" Then
Exit Sub
Else
If MsgBox("Add the following file to your data: " & strFile, vbYesNo,
"Confirm the file is correct:") = vbNo Then
Exit Sub
Else
End If
End If
DoCmd.TransferText acImportDelim, "DISKS", "TableNew", strFile, True
****(I imagine the code is added here to copy the data in TextBox1 to
the Date field in the Disks Table)**********
exit_Command3_Click:
Exit Sub
err_Command3_Click:
MsgBox Err.Number & " " & Err.Description
Resume exit_cmdOpenFile_Click
End Sub
End Sub
**********************************************************************
Any help is appreciated. Thanks.