From: Matthew Wells on
Hello,

I am using Access 2007 with SQL Server 2005 data - all the latest
updates. I am creating a disconnected ado recordset to bind to the form.
I've always used unbound forms, but this contract requires bound forms. The
table has 4 fields, 3 are required and have Allow Null set to false.

The form I'm using has a dropdown to select a sales year. In the form's
OnOpen event I set the value to 2009 - which currently has no data. I then
create the recordset object, disconnect it, and bind it to the form. The
recordset is recreated each time the user selects a sales year. (The Sales
Year dropdown is not bound.)

When the form loads, the default recordset returns 0 records so I use
..AddNew. The form now shows #Error in the textboxes that require data. I
can actually enter data in them and it works. As a matter of fact, when I
start typing in the first textbox, the other #Errors clear.

One thing I tried that worked was to immediately set a value to one of the
required fields so I won't see the #Errors.

This seems very lame. Does anyone know a better way?

Thanks.
--
Matthew Wells
matthew.wells(a)firstbyte.net


From: Salad on
Matthew Wells wrote:
> Hello,
>
> I am using Access 2007 with SQL Server 2005 data - all the latest
> updates. I am creating a disconnected ado recordset to bind to the
> form. I've always used unbound forms, but this contract requires bound
> forms. The table has 4 fields, 3 are required and have Allow Null set
> to false.
>
> The form I'm using has a dropdown to select a sales year. In the form's
> OnOpen event I set the value to 2009 - which currently has no data. I
> then create the recordset object, disconnect it, and bind it to the
> form. The recordset is recreated each time the user selects a sales
> year. (The Sales Year dropdown is not bound.)
>
> When the form loads, the default recordset returns 0 records so I use
> .AddNew. The form now shows #Error in the textboxes that require data.
> I can actually enter data in them and it works. As a matter of fact,
> when I start typing in the first textbox, the other #Errors clear.
>
> One thing I tried that worked was to immediately set a value to one of
> the required fields so I won't see the #Errors.
>
> This seems very lame. Does anyone know a better way?
>
> Thanks.

Don't know.

What happens if you set the default value to "" since you can't have
null but they are required?
From: Matthew Wells on
I set that in SQL Server and it didn't help. Don't have a clue why not. I
don't want to allow empty strings anyway.

Here's something else funny. I normally hide the record selectors and use
my own command buttons. I turned them on and hit the new record button and
I didn't get the #Error messages.

Still clueless...

--
Matthew Wells
matthew.wells(a)firstbyte.net

"Salad" <salad(a)oilandvinegar.com> wrote in message
news:osWdnQiuiq2nj_LWnZ2dnUVZ_qednZ2d(a)earthlink.com...
> Matthew Wells wrote:
>> Hello,
>>
>> I am using Access 2007 with SQL Server 2005 data - all the latest
>> updates. I am creating a disconnected ado recordset to bind to the form.
>> I've always used unbound forms, but this contract requires bound forms.
>> The table has 4 fields, 3 are required and have Allow Null set to false.
>>
>> The form I'm using has a dropdown to select a sales year. In the form's
>> OnOpen event I set the value to 2009 - which currently has no data. I
>> then create the recordset object, disconnect it, and bind it to the form.
>> The recordset is recreated each time the user selects a sales year. (The
>> Sales Year dropdown is not bound.)
>>
>> When the form loads, the default recordset returns 0 records so I use
>> .AddNew. The form now shows #Error in the textboxes that require data.
>> I can actually enter data in them and it works. As a matter of fact,
>> when I start typing in the first textbox, the other #Errors clear.
>>
>> One thing I tried that worked was to immediately set a value to one of
>> the required fields so I won't see the #Errors.
>>
>> This seems very lame. Does anyone know a better way?
>>
>> Thanks.
>
> Don't know.
>
> What happens if you set the default value to "" since you can't have null
> but they are required?