Subform adds blank record

gumbi17

Registered User.
Local time
Today, 17:41
Joined
Aug 23, 2011
Messages
43
I have a subform that stays in data sheet view for entry, the form this sits on is launched by a macro. This macro on the main form launches the form and adds in the linking numbers by a setvalue. The main form has the linked number on it and this number is then linked by master and child to the subform. The problem comes in when you start adding in data. The line of data is filled by using combo boxes and some text fields and ends with a time/date stamp Now(). The problem is, even if you dont fill the entire line if a user refreshes or closes the form it adds a blank entry with the linking number but all fields blank. I know I am over looking a simple setting, what am I missing?

Thanks!
 
Do NOT add the what you name "the linking number". When you fill this number into the control Access think that you start to edit a record. So, in order to not lose data, he (Access) will save the record.
Do a try:
Create a table with only 2 fields:
ID - Autonamber
TestField - is not important the data type.

Start to type into the TestField.
As soon as you do this, the ID field will be filled with the next ID number.
This is happen with your form.

The solution is to change the "add" method that you use with the .Default method for the same control. So, instead to have
ControlName = LinkingNumber
you should have
ControlName.Default = LinkingNumber

Good luck !
 

Users who are viewing this thread

Back
Top Bottom