control source

Lyndseyd

Registered User.
Local time
Today, 07:11
Joined
Jul 6, 2005
Messages
71
Hi all, at the moment all of my field are control sourced. I heard there is a way whereby the field could be unbound and one button it the control source for them all. Im not entirely sure what this means or how to go about it. But i think it would solve the problem of if my users start entering data into a record and then decide to leave it, this record is automatically added to the table, with little or no data. As the data in the table is used for statistics, the table showing records which are not actually there is causing problems. Im not sure if i explained this well, but i would be grateful of any help. Thanx
 
Lyndsey,

Im guessin you want to save the record after you've validated it and made sure all entries are correct?

make your form/fields unbound

If so, have a save button and amend the following code to fit your fields and table source

' NOTE: DAO 3.6 code
Dim db As Database
Dim rs As DAO.Recordset

Set db = CurrentDb
Set rs = db.OpenRecordset("tablename", dbOpenTable)
With rs
.AddNew
.Fields("fieldAintable") = Me.fieldAinForm
.Fields("fieldBintable") = Me.FieldBinForm
.Update
End With
rs.Close
Set rs = Nothing

probably best to have a validation procedure or something similar which makes sure your record is correctly entered then then save to table.

HTH :)
 

Users who are viewing this thread

Back
Top Bottom