Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

dao recordset error trapping

 
   Database Forums (Home) -> Visual Basic -> DAO RSS
Next:  Preferred Access ODBC Linking Method  
Author Message
James Houston

External


Since: Oct 20, 2003
Posts: 6



(Msg. 1) Posted: Wed Mar 22, 2006 10:12 am
Post subject: dao recordset error trapping
Archived from groups: microsoft>public>vb>database>dao (more info?)

I have a dao recordset which I update with the following code:

With rsOrderShip
.Edit
!CustCode = frmOrders.txtSTCustCode.Text
!stcustname = frmOrders.txtSTCustName.Text
!staddress1 = frmOrders.txtSTAddress1.Text
!staddress2 = frmOrders.txtSTAddress2.Text
!stcity = frmOrders.txtSTCity.Text
!ststate = frmOrders.txtSTState.Text
!stzip = frmOrders.txtSTZip.Text
!Phone = frmOrders.txtSTPhone.Text
!Email = frmOrders.txtSTEmail.Text
.Update
End With

If a user does something like enter a text string that's too long for the
field, is there any way to get the name of the field where the error occured
(short of doing something like set a variable to the name of the field
before you try to update it). Thanks in advance.

 >> Stay informed about: dao recordset error trapping 
Back to top
Login to vote
Douglas J. Steele

External


Since: Mar 14, 2004
Posts: 716



(Msg. 2) Posted: Wed Mar 22, 2006 5:29 pm
Post subject: Re: dao recordset error trapping [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Nothing automatic. You'll have to do it yourself, I'm afraid.

However, it's usually a good idea to perform checks like that before trying
to write to the database anyhow.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"James Houston" wrote in message

>I have a dao recordset which I update with the following code:
>
> With rsOrderShip
> .Edit
> !CustCode = frmOrders.txtSTCustCode.Text
> !stcustname = frmOrders.txtSTCustName.Text
> !staddress1 = frmOrders.txtSTAddress1.Text
> !staddress2 = frmOrders.txtSTAddress2.Text
> !stcity = frmOrders.txtSTCity.Text
> !ststate = frmOrders.txtSTState.Text
> !stzip = frmOrders.txtSTZip.Text
> !Phone = frmOrders.txtSTPhone.Text
> !Email = frmOrders.txtSTEmail.Text
> .Update
> End With
>
> If a user does something like enter a text string that's too long for the
> field, is there any way to get the name of the field where the error
> occured (short of doing something like set a variable to the name of the
> field before you try to update it). Thanks in advance.
>

 >> Stay informed about: dao recordset error trapping 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Error 3167 recordset is delete - Hello, ich habe in verschiedenen Newsgroups gesucht aber keine Lösung zu dem folgenden Problem gefunden. Zwei Personen arbeiten gemeinsam mit einem VB6-Programm an einer ACCESS 2000 Datenbank Der Zugriff von VB auf ACCESS erfolgt mit DAO 3.60. Eine de...

Deleting records from DAO recordset - [posted earlier in other group] Hi All, I'm using the following code to delete one or more records from a DAO recordset. The code is working but I was wondering if I need to Update the recordset with: rsDel.Update? Public Function DelRecs(Lstview As....

ADOR.RecordSet and Vista - I've inherited two sets of VB6 based com components from another developer. A set of client side activeX controls and a set of server side com controls. Basically, browser activated client side activex controls invokes server side control on Windows....

Updating DAO Record Moves it to the End of the Recordset - I am trying to loop through a DAO recordset and replace characters as needed. However, when the replacement consists of just appending a character, the first record in the recordset seems to move to the end of the recordset after the first iteration..

Problem with Data1.recordset.AddNew - Hi All I have a Access97 Database and if I delete all the records compat the database when I use AddNew I get an error message Runtime Error '3426': This action was cancelled by an arseociated object. and highlights the Data1.recodset.AddNew line in..
   Database Forums (Home) -> Visual Basic -> DAO All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]