Results 1 to 3 of 3

Thread: problem saving date field

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    India
    Posts
    203

    problem saving date field

    I'm saving the contents of textboxes in 2 the recordset on the click of the Save button. If I hv a blank field in the textbox specified fr Date and I try to save it in the recordset, it givz an error. This happens even when I try 2 append a "" to it.
    TrainingStartDate is a SmallDateTime field

    rsEmployeeInfo!TrainingStartDate = " " & txtTSDate.Text

    figured this wd work

    If Trim(txtTSDate.Text) = "" Then

    rsEmployeeInfo!TrainingStartDate = Null

    Else

    rsEmployeeInfo!TrainingStartDate = " " & txtTSDate.Text

    End If


    Is there any other way around it or is this OK-coz I hv 5-6 Date fields.


    2.) I want 2 know frm where I can use the Date Control->I was told it wd b in the MS Windows Common Controls, but its not there

  2. #2
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    FL
    Posts
    258
    If you are talking about the Date/Time Picker it is in MS Windows Common Controls 2.

  3. #3
    New Member
    Join Date
    Aug 2001
    Location
    Middle Tennessee
    Posts
    9
    You might try typing the text by adding a '#' before and after ..

    For example"
    rstMyRecords.Field("FieldName").Value = "#" & txtBox.Text & "#"

    I usually make sure I convert all data before I put into a database.

    triley

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width