Hi Alberto,
Crosstabs can be tricky creatures -- if you found a way that works, run
with it!
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:
Run-time error '2186':
This property isn't available in Design view.
Interestingly, when I have the button open the crosstab query entitled
CrosstabNumberOfBuilds, I get this error. But when I have the button
reference the query on which the Crosstab query is based, entitled
qryNumberOfBuilds, I do not get the error.
Very odd.
:
Hi Alberto,
I see that FormatDateTime is a built-in Access function -- sorry, I did
not realize that as I have never used it ... strike my remark about
asking you for code.
"and still get the errors"
what is the error message that you are getting?
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'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
:
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.
:
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
(no e-mails, please!)
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.
:
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?