making a textbox excluded from listing a record

  • Thread starter Thread starter dtm
  • Start date Start date
D

dtm

I have a form that i select a record from a list box. based on the selected
record i fill in the data. I have another field that gives current date.
this way when i write the rest of the data i can put in the current date
automatically. to do this i have the default value of this field todays
date.

problems is when i load in the new record it sees this field blank in the
table and wipes out the default value. I have the text box bound to the
table column so that i can write it when i write the record.

I need to be able to either put the date in another way w/o bounding it or
be able to exlude it from being pulled in with the record. the code i am
currently using to pull in the record is:

Private Sub combo4_Change()

' Find the record that matches the control.
' jump to record selected in list box
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[RMA_number] = " & Str(Nz(Me![Combo4], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
'refresh after add
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acRefresh, , acMenuVer70


thanks! dm.
 
It looks as if you're not adding records, but simply filling in data in
existing records.
The DefaultValue is only used when you create a new record.

If your date textbox is named txtDate, you could add this line:
if (txtDate & "" = "") then txtDate = Date()
at the end of the code you posted.
 
Back
Top