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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|