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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Run-time Error 2186



 
 
Thread Tools Display Modes
  #1  
Old January 12th, 2009, 10:21 PM posted to microsoft.public.access.forms
Alberto
external usenet poster
 
Posts: 69
Default Run-time Error 2186

Everytime I open up change a form from the "Design" to the "View" format, I
get the following error:
Run-time Error: 2186
This property isn't available in Design view

I believe the error stems from the fact that the form has several buttons on
it that open queries that reference a two date parameter fields and
manufacturer parameter fields that filter the query when it is run. I know
this because when I take those buttons off of the form, the error disappears.

When I obtain the "Run-time Error 2186" and hit debug, the following is
highlighted:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(Form_StartForm.DateFrom.Value, 2)
End Function

or

Public Function Manufacturer() As String
If Not Form_StartForm.ManufacturersID.Value Then
Manufacturer = Form_StartForm.ManufacturersID.Value
End If
End Function


Also, sometimes the run-time error appears as a 2467 error. THis occurs the
first time that I open the form.

I am fairly green with MSFT Access so I don't even know where to begin.
What should I do to solve this?




  #2  
Old January 13th, 2009, 01:29 AM posted to microsoft.public.access.forms
strive4peace
external usenet poster
 
Posts: 1,670
Default Run-time Error 2186

Hi Alberto,

forms!Form_StartForm!DateFrom.Value
or
forms!Form_StartForm.DateFrom.value

since Value is the default property, you can also leave .Value off the end


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




Alberto wrote:
Everytime I open up change a form from the "Design" to the "View" format, I
get the following error:
Run-time Error: 2186
This property isn't available in Design view

I believe the error stems from the fact that the form has several buttons on
it that open queries that reference a two date parameter fields and
manufacturer parameter fields that filter the query when it is run. I know
this because when I take those buttons off of the form, the error disappears.

When I obtain the "Run-time Error 2186" and hit debug, the following is
highlighted:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(Form_StartForm.DateFrom.Value, 2)
End Function

or

Public Function Manufacturer() As String
If Not Form_StartForm.ManufacturersID.Value Then
Manufacturer = Form_StartForm.ManufacturersID.Value
End If
End Function


Also, sometimes the run-time error appears as a 2467 error. THis occurs the
first time that I open the form.

I am fairly green with MSFT Access so I don't even know where to begin.
What should I do to solve this?




  #3  
Old January 13th, 2009, 05:00 PM posted to microsoft.public.access.forms
Alberto
external usenet poster
 
Posts: 69
Default Run-time Error 2186

Thanks. I tried what you suggested and I changed it from:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(Form_StartForm.DateFrom.Value, 2)
End Function


to:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(forms!Form_StartForm!DateFrom.Value , 2)
End Function


I now get:

Run-time error 2450.
Can't find the form 'l' referred to in a macro expression or Visual Basic
code.



"strive4peace" wrote:

Hi Alberto,

forms!Form_StartForm!DateFrom.Value
or
forms!Form_StartForm.DateFrom.value

since Value is the default property, you can also leave .Value off the end


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




Alberto wrote:
Everytime I open up change a form from the "Design" to the "View" format, I
get the following error:
Run-time Error: 2186
This property isn't available in Design view

I believe the error stems from the fact that the form has several buttons on
it that open queries that reference a two date parameter fields and
manufacturer parameter fields that filter the query when it is run. I know
this because when I take those buttons off of the form, the error disappears.

When I obtain the "Run-time Error 2186" and hit debug, the following is
highlighted:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(Form_StartForm.DateFrom.Value, 2)
End Function

or

Public Function Manufacturer() As String
If Not Form_StartForm.ManufacturersID.Value Then
Manufacturer = Form_StartForm.ManufacturersID.Value
End If
End Function


Also, sometimes the run-time error appears as a 2467 error. THis occurs the
first time that I open the form.

I am fairly green with MSFT Access so I don't even know where to begin.
What should I do to solve this?





  #4  
Old January 13th, 2009, 05:12 PM posted to microsoft.public.access.forms
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Run-time Error 2186

Assuming your form is actually named StartForm, use
Forms!StartForm!DateFrom.

Form_StartForm is actually how you refer to the form's Class Module.

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


"Alberto" wrote in message
...
Thanks. I tried what you suggested and I changed it from:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(Form_StartForm.DateFrom.Value, 2)
End Function


to:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(forms!Form_StartForm!DateFrom.Value , 2)
End Function


I now get:

Run-time error 2450.
Can't find the form 'l' referred to in a macro expression or Visual Basic
code.



"strive4peace" wrote:

Hi Alberto,

forms!Form_StartForm!DateFrom.Value
or
forms!Form_StartForm.DateFrom.value

since Value is the default property, you can also leave .Value off the
end


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




Alberto wrote:
Everytime I open up change a form from the "Design" to the "View"
format, I
get the following error:
Run-time Error: 2186
This property isn't available in Design view

I believe the error stems from the fact that the form has several
buttons on
it that open queries that reference a two date parameter fields and
manufacturer parameter fields that filter the query when it is run. I
know
this because when I take those buttons off of the form, the error
disappears.

When I obtain the "Run-time Error 2186" and hit debug, the following is
highlighted:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(Form_StartForm.DateFrom.Value, 2)
End Function

or

Public Function Manufacturer() As String
If Not Form_StartForm.ManufacturersID.Value Then
Manufacturer = Form_StartForm.ManufacturersID.Value
End If
End Function


Also, sometimes the run-time error appears as a 2467 error. THis
occurs the
first time that I open the form.

I am fairly green with MSFT Access so I don't even know where to begin.
What should I do to solve this?







  #5  
Old January 13th, 2009, 05:17 PM posted to microsoft.public.access.forms
Alberto
external usenet poster
 
Posts: 69
Default Run-time Error 2186

I should also point out that there are other buttons that also reference the
DateFrom and DateTo fields on the form that work well and do not create these
2467 or 2186 errors.


"Alberto" wrote:

Everytime I open up change a form from the "Design" to the "View" format, I
get the following error:
Run-time Error: 2186
This property isn't available in Design view

I believe the error stems from the fact that the form has several buttons on
it that open queries that reference a two date parameter fields and
manufacturer parameter fields that filter the query when it is run. I know
this because when I take those buttons off of the form, the error disappears.

When I obtain the "Run-time Error 2186" and hit debug, the following is
highlighted:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(Form_StartForm.DateFrom.Value, 2)
End Function

or

Public Function Manufacturer() As String
If Not Form_StartForm.ManufacturersID.Value Then
Manufacturer = Form_StartForm.ManufacturersID.Value
End If
End Function


Also, sometimes the run-time error appears as a 2467 error. THis occurs the
first time that I open the form.

I am fairly green with MSFT Access so I don't even know where to begin.
What should I do to solve this?




  #6  
Old January 13th, 2009, 05:56 PM posted to microsoft.public.access.forms
strive4peace
external usenet poster
 
Posts: 1,670
Default Run-time Error 2186

good catch, Doug

Warm Regards,
Crystal

*
(: have an awesome day
*




Douglas J. Steele wrote:
Assuming your form is actually named StartForm, use
Forms!StartForm!DateFrom.

Form_StartForm is actually how you refer to the form's Class Module.

  #7  
Old January 13th, 2009, 05:58 PM posted to microsoft.public.access.forms
strive4peace
external usenet poster
 
Posts: 1,670
Default Run-time Error 2186

Hi Alberto,

if you are in the code behind your form, you can use this reference form:

Me.controlname

ie:

Me.DateTo

the nice thing about using Me. is that, once you type it into the code,
Access shows you options you can pick smile


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




Alberto wrote:
I should also point out that there are other buttons that also reference the
DateFrom and DateTo fields on the form that work well and do not create these
2467 or 2186 errors.


"Alberto" wrote:

Everytime I open up change a form from the "Design" to the "View" format, I
get the following error:
Run-time Error: 2186
This property isn't available in Design view

I believe the error stems from the fact that the form has several buttons on
it that open queries that reference a two date parameter fields and
manufacturer parameter fields that filter the query when it is run. I know
this because when I take those buttons off of the form, the error disappears.

When I obtain the "Run-time Error 2186" and hit debug, the following is
highlighted:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(Form_StartForm.DateFrom.Value, 2)
End Function

or

Public Function Manufacturer() As String
If Not Form_StartForm.ManufacturersID.Value Then
Manufacturer = Form_StartForm.ManufacturersID.Value
End If
End Function


Also, sometimes the run-time error appears as a 2467 error. THis occurs the
first time that I open the form.

I am fairly green with MSFT Access so I don't even know where to begin.
What should I do to solve this?




  #8  
Old January 13th, 2009, 06:13 PM posted to microsoft.public.access.forms
Alberto
external usenet poster
 
Posts: 69
Default Run-time Error 2186

I changed it to:
Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(Forms!StartForm!DateFrom.Value, 2)
End Function

and still get the errors.

I am at a loss because there are other buttons that are not generating this
error even though they rely on the same DateFrom and DateTo paramters.


"Douglas J. Steele" wrote:

Assuming your form is actually named StartForm, use
Forms!StartForm!DateFrom.

Form_StartForm is actually how you refer to the form's Class Module.

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


"Alberto" wrote in message
...
Thanks. I tried what you suggested and I changed it from:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(Form_StartForm.DateFrom.Value, 2)
End Function


to:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(forms!Form_StartForm!DateFrom.Value , 2)
End Function


I now get:

Run-time error 2450.
Can't find the form 'l' referred to in a macro expression or Visual Basic
code.



"strive4peace" wrote:

Hi Alberto,

forms!Form_StartForm!DateFrom.Value
or
forms!Form_StartForm.DateFrom.value

since Value is the default property, you can also leave .Value off the
end


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




Alberto wrote:
Everytime I open up change a form from the "Design" to the "View"
format, I
get the following error:
Run-time Error: 2186
This property isn't available in Design view

I believe the error stems from the fact that the form has several
buttons on
it that open queries that reference a two date parameter fields and
manufacturer parameter fields that filter the query when it is run. I
know
this because when I take those buttons off of the form, the error
disappears.

When I obtain the "Run-time Error 2186" and hit debug, the following is
highlighted:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(Form_StartForm.DateFrom.Value, 2)
End Function

or

Public Function Manufacturer() As String
If Not Form_StartForm.ManufacturersID.Value Then
Manufacturer = Form_StartForm.ManufacturersID.Value
End If
End Function


Also, sometimes the run-time error appears as a 2467 error. THis
occurs the
first time that I open the form.

I am fairly green with MSFT Access so I don't even know where to begin.
What should I do to solve this?








  #9  
Old January 13th, 2009, 06:43 PM posted to microsoft.public.access.forms
strive4peace
external usenet poster
 
Posts: 1,670
Default Run-time Error 2186

Hi Alberto,

if you are returning the value as a date data type, do not format it as
that converts to a string. What is the code for FormatDateTime?

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




Alberto wrote:
I changed it to:
Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(Forms!StartForm!DateFrom.Value, 2)
End Function

and still get the errors.

I am at a loss because there are other buttons that are not generating this
error even though they rely on the same DateFrom and DateTo paramters.


"Douglas J. Steele" wrote:

Assuming your form is actually named StartForm, use
Forms!StartForm!DateFrom.

Form_StartForm is actually how you refer to the form's Class Module.

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


"Alberto" wrote in message
...
Thanks. I tried what you suggested and I changed it from:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(Form_StartForm.DateFrom.Value, 2)
End Function


to:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(forms!Form_StartForm!DateFrom.Value , 2)
End Function


I now get:

Run-time error 2450.
Can't find the form 'l' referred to in a macro expression or Visual Basic
code.



"strive4peace" wrote:

Hi Alberto,

forms!Form_StartForm!DateFrom.Value
or
forms!Form_StartForm.DateFrom.value

since Value is the default property, you can also leave .Value off the
end


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




Alberto wrote:
Everytime I open up change a form from the "Design" to the "View"
format, I
get the following error:
Run-time Error: 2186
This property isn't available in Design view

I believe the error stems from the fact that the form has several
buttons on
it that open queries that reference a two date parameter fields and
manufacturer parameter fields that filter the query when it is run. I
know
this because when I take those buttons off of the form, the error
disappears.

When I obtain the "Run-time Error 2186" and hit debug, the following is
highlighted:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(Form_StartForm.DateFrom.Value, 2)
End Function

or

Public Function Manufacturer() As String
If Not Form_StartForm.ManufacturersID.Value Then
Manufacturer = Form_StartForm.ManufacturersID.Value
End If
End Function


Also, sometimes the run-time error appears as a 2467 error. THis
occurs the
first time that I open the form.

I am fairly green with MSFT Access so I don't even know where to begin.
What should I do to solve this?






  #10  
Old January 13th, 2009, 10:16 PM posted to microsoft.public.access.forms
Alberto
external usenet poster
 
Posts: 69
Default Run-time Error 2186

I'm not following when you say "what is the code for FormatDateTime?" Can
you expand? I'm a bit of an Access neophyte.

Also, another bit of information. The queries that appear to be giving me
the most problems are crosstab queries where the columns are weeks

Wk1 Wk2 Wk3 Wk4
# of builds

The date function within the crosstab query I'm using to create the weekly
total is:
Format(Now()+(DateDiff("ww",Now(),[invoice_date])*7),"yyyy mm-dd")

Alberto



"strive4peace" wrote:

Hi Alberto,

if you are returning the value as a date data type, do not format it as
that converts to a string. What is the code for FormatDateTime?

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




Alberto wrote:
I changed it to:
Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(Forms!StartForm!DateFrom.Value, 2)
End Function

and still get the errors.

I am at a loss because there are other buttons that are not generating this
error even though they rely on the same DateFrom and DateTo paramters.


"Douglas J. Steele" wrote:

Assuming your form is actually named StartForm, use
Forms!StartForm!DateFrom.

Form_StartForm is actually how you refer to the form's Class Module.

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


"Alberto" wrote in message
...
Thanks. I tried what you suggested and I changed it from:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(Form_StartForm.DateFrom.Value, 2)
End Function


to:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(forms!Form_StartForm!DateFrom.Value , 2)
End Function


I now get:

Run-time error 2450.
Can't find the form 'l' referred to in a macro expression or Visual Basic
code.



"strive4peace" wrote:

Hi Alberto,

forms!Form_StartForm!DateFrom.Value
or
forms!Form_StartForm.DateFrom.value

since Value is the default property, you can also leave .Value off the
end


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day
*




Alberto wrote:
Everytime I open up change a form from the "Design" to the "View"
format, I
get the following error:
Run-time Error: 2186
This property isn't available in Design view

I believe the error stems from the fact that the form has several
buttons on
it that open queries that reference a two date parameter fields and
manufacturer parameter fields that filter the query when it is run. I
know
this because when I take those buttons off of the form, the error
disappears.

When I obtain the "Run-time Error 2186" and hit debug, the following is
highlighted:

Public Function FromDate() As Date
' Get FROM date from DatePicker
FromDate = FormatDateTime(Form_StartForm.DateFrom.Value, 2)
End Function

or

Public Function Manufacturer() As String
If Not Form_StartForm.ManufacturersID.Value Then
Manufacturer = Form_StartForm.ManufacturersID.Value
End If
End Function


Also, sometimes the run-time error appears as a 2467 error. THis
occurs the
first time that I open the form.

I am fairly green with MSFT Access so I don't even know where to begin.
What should I do to solve this?







 




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 08:28 AM.


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