dbTalk Databases Forums  

Multiple user database where one user is getting an error and the other is not

comp.database.ms-access comp.database.ms-access


Discuss Multiple user database where one user is getting an error and the other is not in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Amber S.
 
Posts: n/a

Default Multiple user database where one user is getting an error and the other is not - 04-01-2004 , 11:39 AM






I am sure this has to do with some setting difference between the
Microsoft Access install on the two user's machines, but I cannot
pinpoint the problem.

Here is the code:

'appends a new record and fills in the relevant fields:
Private Sub btnNewDay_Click()
Dim rstTemp As Recordset 'temporary recordset object
Dim dtmNewDate As Date 'date of the new records
Dim qdfCarried As QueryDef 'query to propagate the
unprocessed carried items

Set rstTemp = Me.RecordsetClone 'clone the form's recordset

'move to the last record if the recordset is not empty:
If Not (rstTemp.BOF And rstTemp.EOF) Then rstTemp.MoveLast

rstTemp.AddNew 'append a new record

'calculate the new date, by default the next day:
'************************************************* **************************
dtmNewDate = Me!Date + 1 '**HERE IS WHERE ONE GETS AN ERROR MESSAGE**
'************************************************* **************************
If WeekDay(dtmNewDate) = vbSaturday Then dtmNewDate = dtmNewDate + 2
'if next day is Saturday, skip to Monday
rstTemp!BankID = Me!BankID 'fill in the BankID
rstTemp!Date = dtmNewDate 'increment the date

rstTemp.Update 'save the changes

rstTemp.MoveLast

Me.Bookmark = rstTemp.Bookmark 'move to the record

End Sub

'***************END OF CODE**************

when it hits the line dtmNewDate = me!date + 1, while toggling through
the code and placing my cursor over me!date, the value of that field
is NULL. Therefore she receives a #94 Error: Invalid use of NULL,
however the other user does not receive this error message when she is
in the same exact database and clicks on the same exact button. Any
suggestions would be very much appreciated!

Thanks,
Amber

Reply With Quote
  #2  
Old   
Sidharta
 
Posts: n/a

Default Re: Multiple user database where one user is getting an error and the other is not - 04-04-2004 , 05:32 AM






try to replace the problem line with:

dtmNewDate = DateAdd("d",1,Date)

Also using 'Date' as name of a table field or name of form control is
a very bad idea.


amber_smith (AT) centraltechnology (DOT) net (Amber S.) wrote in message news:<ddfe097.0404010839.50a7edb7 (AT) posting (DOT) google.com>...
Quote:
I am sure this has to do with some setting difference between the
Microsoft Access install on the two user's machines, but I cannot
pinpoint the problem.

Here is the code:

'appends a new record and fills in the relevant fields:
Private Sub btnNewDay_Click()
Dim rstTemp As Recordset 'temporary recordset object
Dim dtmNewDate As Date 'date of the new records
Dim qdfCarried As QueryDef 'query to propagate the
unprocessed carried items

Set rstTemp = Me.RecordsetClone 'clone the form's recordset

'move to the last record if the recordset is not empty:
If Not (rstTemp.BOF And rstTemp.EOF) Then rstTemp.MoveLast

rstTemp.AddNew 'append a new record

'calculate the new date, by default the next day:
'************************************************* **************************
dtmNewDate = Me!Date + 1 '**HERE IS WHERE ONE GETS AN ERROR MESSAGE**
'************************************************* **************************
If WeekDay(dtmNewDate) = vbSaturday Then dtmNewDate = dtmNewDate + 2
'if next day is Saturday, skip to Monday
rstTemp!BankID = Me!BankID 'fill in the BankID
rstTemp!Date = dtmNewDate 'increment the date

rstTemp.Update 'save the changes

rstTemp.MoveLast

Me.Bookmark = rstTemp.Bookmark 'move to the record

End Sub

'***************END OF CODE**************

when it hits the line dtmNewDate = me!date + 1, while toggling through
the code and placing my cursor over me!date, the value of that field
is NULL. Therefore she receives a #94 Error: Invalid use of NULL,
however the other user does not receive this error message when she is
in the same exact database and clicks on the same exact button. Any
suggestions would be very much appreciated!

Thanks,
Amber

Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.