If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > "Default Value" problem with Access 2000?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-18-03, 07:50
doctorzeus doctorzeus is offline
Registered User
 
Join Date: Jul 2003
Location: London
Posts: 5
"Default Value" problem with data control and DAO3.6?

Hi,

I have been developing a system which has a vb4.0 front end and a access 95 database for several years.
I have recently converted to using VB6(sp5) and an Access 2000 database and I have upgraded to using DAO 3.6. Everything seems fine except for when I add new records.

If I have a recordset that has a numeric field, and the default value is 22 then adding a new record gives different results depending on whether I have records in the recordset or not.

If I set up a recordset with records already in it:

(Before Adding New, the recordset is at the first record and bound text boxes are showing the correct values from the underlying data)

Add a New record.
The text box which is bound to the numeric field with the default value of 22, now displays 22.
Now I update the record. The data is as expected (default value is 22)




If I set up a recordset with NO records in it:
(Before Adding New, there is no record to show so all bound text boxes are blank)

Add a New record.
The text box which is bound to the numeric field with the default value of 22, does not change, it is still blank!
Now I update the record. The data has got the default value of 22.


This DID NOT happen when using VB4 and Access 95!
I don't know if there is an easy way round this. After adding new I can populate the text boxes with the default values. Or I could add in a dummy record first and then delete it.
Either of these two methods is not ideal as the program has hundreds of
places that have this kind of behaviour.
Is there a simple way of "refreshing" the text box after adding new? I have tried the UpdateControls method and it doesn't seem to do anything.

Any help on this would be greatly appreciated!

Steve Davis

Last edited by doctorzeus; 07-28-03 at 06:31.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On