issue with property not being supported by object

A

Associates

Hi,

I wonder if i could get some help here with the following error message

Object doesn't support this property or method

I got this error when attempting to close a form in Access

Private Sub COM_CloseForm_Click()
On Error GoTo Err_COM_CloseForm_Click

DoCmd.Close

If Application.CurrentProject.AllForms("JobProposal List").IsLoaded Then
[Forms]![Job Proposal List]!LB_JobList.Refresh
End If


Exit_COM_CloseForm_Click:
Exit Sub

Err_COM_CloseForm_Click:
MsgBox Err.Description
Resume Exit_COM_CloseForm_Click

End Sub

I do not understand which object it is referring to. However, i have been
using this code in my previous Access database and it has always worked for
me. Could anyone show me the right way to do this?

Any help would be greatly appreciated.

Thank you in advance
 
D

Dirk Goldgar

Associates said:
Hi,

I wonder if i could get some help here with the following error message

Object doesn't support this property or method

I got this error when attempting to close a form in Access

Private Sub COM_CloseForm_Click()
On Error GoTo Err_COM_CloseForm_Click

DoCmd.Close

If Application.CurrentProject.AllForms("JobProposal List").IsLoaded
Then
[Forms]![Job Proposal List]!LB_JobList.Refresh
End If


Exit_COM_CloseForm_Click:
Exit Sub

Err_COM_CloseForm_Click:
MsgBox Err.Description
Resume Exit_COM_CloseForm_Click

End Sub

I do not understand which object it is referring to. However, i have been
using this code in my previous Access database and it has always worked
for
me. Could anyone show me the right way to do this?


To find out which line is causing the error, temporarily comment out the "On
Error GoTo" statement. Or set a breakpoint on the procedure, trigger the
event, and step through the code until you see from which line it jumps to
the error-handler.

My guess would be that the error is on:
[Forms]![Job Proposal List]!LB_JobList.Refresh

Is LB_JobList a list box? If so, it has a Requery method, but not a Refresh
method.
 
A

Associates

Thank you Dirk for your reply.

It works now after changing refresh to requery.

Thank you

Dirk Goldgar said:
Associates said:
Hi,

I wonder if i could get some help here with the following error message

Object doesn't support this property or method

I got this error when attempting to close a form in Access

Private Sub COM_CloseForm_Click()
On Error GoTo Err_COM_CloseForm_Click

DoCmd.Close

If Application.CurrentProject.AllForms("JobProposal List").IsLoaded
Then
[Forms]![Job Proposal List]!LB_JobList.Refresh
End If


Exit_COM_CloseForm_Click:
Exit Sub

Err_COM_CloseForm_Click:
MsgBox Err.Description
Resume Exit_COM_CloseForm_Click

End Sub

I do not understand which object it is referring to. However, i have been
using this code in my previous Access database and it has always worked
for
me. Could anyone show me the right way to do this?


To find out which line is causing the error, temporarily comment out the "On
Error GoTo" statement. Or set a breakpoint on the procedure, trigger the
event, and step through the code until you see from which line it jumps to
the error-handler.

My guess would be that the error is on:
[Forms]![Job Proposal List]!LB_JobList.Refresh

Is LB_JobList a list box? If so, it has a Requery method, but not a Refresh
method.


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top