A Microsoft Office (Excel, Word) forum. OfficeFrustration

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   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Not sure what to do with this error



 
 
Thread Tools Display Modes
  #1  
Old April 30th, 2010, 03:01 PM posted to microsoft.public.access.gettingstarted
mike
external usenet poster
 
Posts: 3,942
Default Not sure what to do with this error

Folks,

I"m trying to figure out what to do with an error we are getting, and I
don't know what I'm looking at unfortunately. We had a employee who created
a glorified mail merg with access 2003. He has since left the company. We
have users wanting to use the program, and we are getting an error, and I
don't know how to fix it. Have not done any access programming myself.

Users are getting a Run-Time Error 2683 - There is no object in this
control. A quick google search mentions registering mscomctl2.ocx, but that
doesn't seem to make the error go away.

When I hit debug, I get this:

'This code causes the Commitment Expiration date text box--which i am using
as label
'to change based on a comparison of todays date and the date in the
DatePicker for
'the commitment expiration date.

Private Sub Form_Current()
If Me!CommtExpireDateZ = Now() Then
Me![CommtLabel] = "Commitment has EXPIRED!"
Else
Me![CommtLabel] = "Commitment Expiration:"
End If

End Sub

The "If Me!CommtExpireDateZ =Now() Then line is hightlighted in the debug
screen.

I have no idea what to do to fix this, any advice from the experts here?

Thanks,

Mike



  #2  
Old April 30th, 2010, 03:30 PM posted to microsoft.public.access.gettingstarted
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default Not sure what to do with this error

With the database open press Ctrl + g. In the Immediate window type this and
press Enter:

Debug.Print Now()

You should get the current date and time. If not you probably have a
reference problem.

If Me!CommtExpireDateZ is null, this could cause a problem as it can't be
evaluated against Now(). You might want to wrap it in the NZ function.

Next with the form open and on a record, type something like the following
in the Immediate window the hit enter:

Debug.Print Forms![TheFormsName]![CommtExpireDateZ]

Make sure to insert the correct form name. It should return the data
displayed in that field. If not, there's a problem.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Mike" wrote:

Folks,

I"m trying to figure out what to do with an error we are getting, and I
don't know what I'm looking at unfortunately. We had a employee who created
a glorified mail merg with access 2003. He has since left the company. We
have users wanting to use the program, and we are getting an error, and I
don't know how to fix it. Have not done any access programming myself.

Users are getting a Run-Time Error 2683 - There is no object in this
control. A quick google search mentions registering mscomctl2.ocx, but that
doesn't seem to make the error go away.

When I hit debug, I get this:

'This code causes the Commitment Expiration date text box--which i am using
as label
'to change based on a comparison of todays date and the date in the
DatePicker for
'the commitment expiration date.

Private Sub Form_Current()
If Me!CommtExpireDateZ = Now() Then
Me![CommtLabel] = "Commitment has EXPIRED!"
Else
Me![CommtLabel] = "Commitment Expiration:"
End If

End Sub

The "If Me!CommtExpireDateZ =Now() Then line is hightlighted in the debug
screen.

I have no idea what to do to fix this, any advice from the experts here?

Thanks,

Mike



  #3  
Old April 30th, 2010, 03:59 PM posted to microsoft.public.access.gettingstarted
mike
external usenet poster
 
Posts: 3,942
Default Not sure what to do with this error

Jerry,

Thanks for the thorough response. I tried your first suggestion and it
returned the current date.

I'm trying to figure out the Nz command, but am getting a compile error, so
I'm sure it's more than putting Nz in front of that line, but I googled it,
and didn't know where to go next with this part: (sorry, I've not done this
before at all)

Private Sub Form_Current()
Nz If Me!CommtExpireDateZ = Now() Then
Me![CommtLabel] = "Commitment has EXPIRED!"
Else
Me![CommtLabel] = "Commitment Expiration:"
End If

End Sub

Also, I tried to do your suggestion about with the form open and on a record
to type in your suggestion, but got a different error and wasn't sure if the
Nz function from above had to be working yet. I get this (not sure if I am
doing this right either):

Runtime Error :2450. It says it can't find the form referred to. I'm
inputting the form listed in the left hand upper pane of the debug window
called Form_ClientDataForm. There are 3 other forms listed, and I haven't
tried them all, but I think this one is the one. Again, not sure if I am
doing this right.

If you have any further advice, I would appreciate it. Again, I haven't
done this before and I"m sure I'm messing it up in some way.

Mike








"Jerry Whittle" wrote:

With the database open press Ctrl + g. In the Immediate window type this and
press Enter:

Debug.Print Now()

You should get the current date and time. If not you probably have a
reference problem.

If Me!CommtExpireDateZ is null, this could cause a problem as it can't be
evaluated against Now(). You might want to wrap it in the NZ function.

Next with the form open and on a record, type something like the following
in the Immediate window the hit enter:

Debug.Print Forms![TheFormsName]![CommtExpireDateZ]

Make sure to insert the correct form name. It should return the data
displayed in that field. If not, there's a problem.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Mike" wrote:

Folks,

I"m trying to figure out what to do with an error we are getting, and I
don't know what I'm looking at unfortunately. We had a employee who created
a glorified mail merg with access 2003. He has since left the company. We
have users wanting to use the program, and we are getting an error, and I
don't know how to fix it. Have not done any access programming myself.

Users are getting a Run-Time Error 2683 - There is no object in this
control. A quick google search mentions registering mscomctl2.ocx, but that
doesn't seem to make the error go away.

When I hit debug, I get this:

'This code causes the Commitment Expiration date text box--which i am using
as label
'to change based on a comparison of todays date and the date in the
DatePicker for
'the commitment expiration date.

Private Sub Form_Current()
If Me!CommtExpireDateZ = Now() Then
Me![CommtLabel] = "Commitment has EXPIRED!"
Else
Me![CommtLabel] = "Commitment Expiration:"
End If

End Sub

The "If Me!CommtExpireDateZ =Now() Then line is hightlighted in the debug
screen.

I have no idea what to do to fix this, any advice from the experts here?

Thanks,

Mike



  #4  
Old April 30th, 2010, 04:55 PM posted to microsoft.public.access.gettingstarted
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default Not sure what to do with this error

Try this:

If Nz(Me!CommtExpireDateZ, 0) = Now() Then

If CommtExpireDateZ is null, it will return a 0 which should return
Commitment has EXPIRED. If you would rather see Commitment Expiration when
there is a null, change the 0 above to 100000. That should for for a few
decades.

Try the thing with the form without the NZ function. It would not be needed
there.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Mike" wrote:

Jerry,

Thanks for the thorough response. I tried your first suggestion and it
returned the current date.

I'm trying to figure out the Nz command, but am getting a compile error, so
I'm sure it's more than putting Nz in front of that line, but I googled it,
and didn't know where to go next with this part: (sorry, I've not done this
before at all)

Private Sub Form_Current()
Nz If Me!CommtExpireDateZ = Now() Then
Me![CommtLabel] = "Commitment has EXPIRED!"
Else
Me![CommtLabel] = "Commitment Expiration:"
End If

End Sub

Also, I tried to do your suggestion about with the form open and on a record
to type in your suggestion, but got a different error and wasn't sure if the
Nz function from above had to be working yet. I get this (not sure if I am
doing this right either):

Runtime Error :2450. It says it can't find the form referred to. I'm
inputting the form listed in the left hand upper pane of the debug window
called Form_ClientDataForm. There are 3 other forms listed, and I haven't
tried them all, but I think this one is the one. Again, not sure if I am
doing this right.

If you have any further advice, I would appreciate it. Again, I haven't
done this before and I"m sure I'm messing it up in some way.

Mike








"Jerry Whittle" wrote:

With the database open press Ctrl + g. In the Immediate window type this and
press Enter:

Debug.Print Now()

You should get the current date and time. If not you probably have a
reference problem.

If Me!CommtExpireDateZ is null, this could cause a problem as it can't be
evaluated against Now(). You might want to wrap it in the NZ function.

Next with the form open and on a record, type something like the following
in the Immediate window the hit enter:

Debug.Print Forms![TheFormsName]![CommtExpireDateZ]

Make sure to insert the correct form name. It should return the data
displayed in that field. If not, there's a problem.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Mike" wrote:

Folks,

I"m trying to figure out what to do with an error we are getting, and I
don't know what I'm looking at unfortunately. We had a employee who created
a glorified mail merg with access 2003. He has since left the company. We
have users wanting to use the program, and we are getting an error, and I
don't know how to fix it. Have not done any access programming myself.

Users are getting a Run-Time Error 2683 - There is no object in this
control. A quick google search mentions registering mscomctl2.ocx, but that
doesn't seem to make the error go away.

When I hit debug, I get this:

'This code causes the Commitment Expiration date text box--which i am using
as label
'to change based on a comparison of todays date and the date in the
DatePicker for
'the commitment expiration date.

Private Sub Form_Current()
If Me!CommtExpireDateZ = Now() Then
Me![CommtLabel] = "Commitment has EXPIRED!"
Else
Me![CommtLabel] = "Commitment Expiration:"
End If

End Sub

The "If Me!CommtExpireDateZ =Now() Then line is hightlighted in the debug
screen.

I have no idea what to do to fix this, any advice from the experts here?

Thanks,

Mike



  #5  
Old April 30th, 2010, 08:37 PM posted to microsoft.public.access.gettingstarted
mike
external usenet poster
 
Posts: 3,942
Default Not sure what to do with this error

Jerry,

I tried what you send me below, and when I put the Debug code into the
Immediate window, it gives me the original Runtime error 2683. Any other
suggestions?

Thanks again for your help.

Mike


"Jerry Whittle" wrote:

Try this:

If Nz(Me!CommtExpireDateZ, 0) = Now() Then

If CommtExpireDateZ is null, it will return a 0 which should return
Commitment has EXPIRED. If you would rather see Commitment Expiration when
there is a null, change the 0 above to 100000. That should for for a few
decades.

Try the thing with the form without the NZ function. It would not be needed
there.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Mike" wrote:

Jerry,

Thanks for the thorough response. I tried your first suggestion and it
returned the current date.

I'm trying to figure out the Nz command, but am getting a compile error, so
I'm sure it's more than putting Nz in front of that line, but I googled it,
and didn't know where to go next with this part: (sorry, I've not done this
before at all)

Private Sub Form_Current()
Nz If Me!CommtExpireDateZ = Now() Then
Me![CommtLabel] = "Commitment has EXPIRED!"
Else
Me![CommtLabel] = "Commitment Expiration:"
End If

End Sub

Also, I tried to do your suggestion about with the form open and on a record
to type in your suggestion, but got a different error and wasn't sure if the
Nz function from above had to be working yet. I get this (not sure if I am
doing this right either):

Runtime Error :2450. It says it can't find the form referred to. I'm
inputting the form listed in the left hand upper pane of the debug window
called Form_ClientDataForm. There are 3 other forms listed, and I haven't
tried them all, but I think this one is the one. Again, not sure if I am
doing this right.

If you have any further advice, I would appreciate it. Again, I haven't
done this before and I"m sure I'm messing it up in some way.

Mike








"Jerry Whittle" wrote:

With the database open press Ctrl + g. In the Immediate window type this and
press Enter:

Debug.Print Now()

You should get the current date and time. If not you probably have a
reference problem.

If Me!CommtExpireDateZ is null, this could cause a problem as it can't be
evaluated against Now(). You might want to wrap it in the NZ function.

Next with the form open and on a record, type something like the following
in the Immediate window the hit enter:

Debug.Print Forms![TheFormsName]![CommtExpireDateZ]

Make sure to insert the correct form name. It should return the data
displayed in that field. If not, there's a problem.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Mike" wrote:

Folks,

I"m trying to figure out what to do with an error we are getting, and I
don't know what I'm looking at unfortunately. We had a employee who created
a glorified mail merg with access 2003. He has since left the company. We
have users wanting to use the program, and we are getting an error, and I
don't know how to fix it. Have not done any access programming myself.

Users are getting a Run-Time Error 2683 - There is no object in this
control. A quick google search mentions registering mscomctl2.ocx, but that
doesn't seem to make the error go away.

When I hit debug, I get this:

'This code causes the Commitment Expiration date text box--which i am using
as label
'to change based on a comparison of todays date and the date in the
DatePicker for
'the commitment expiration date.

Private Sub Form_Current()
If Me!CommtExpireDateZ = Now() Then
Me![CommtLabel] = "Commitment has EXPIRED!"
Else
Me![CommtLabel] = "Commitment Expiration:"
End If

End Sub

The "If Me!CommtExpireDateZ =Now() Then line is hightlighted in the debug
screen.

I have no idea what to do to fix this, any advice from the experts here?

Thanks,

Mike



 




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 Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:17 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.