Access 2013 Default Value Expression Builder Issue - ms-access

I am trying to do a default value in a text box that is a default value for a form which has a specific file path added to a file name. However when I put the following into the expression builder for the default value I get a #Name? error in the form text box.
=DLookUp("[FilePath]","[DEFAULT_FILE_PATHS]","[DEFAULT_FILE_PATHS].ID = 4") & Year([Date]) & Format(DateAdd("m",-1,[Date]),"mm") & " Sales Summary.csv"
Any suggestions would be greatly appreciated. Thanks.

Try this:
=DLookUp("[FilePath]","[DEFAULT_FILE_PATHS]","[DEFAULT_FILE_PATHS].ID = 4") & Format(DateAdd("m",-1, Date()),"yyyymm") & " Sales Summary.csv"

Related

Using textbox to update another text box in MS Access

I am trying to update a textbox#2 based on the value in Textbox#1.
The value in the textbox#1 is taken from from a string using " Mid([ScantheCode],1,10)" from ScantheCode box. I have tried couple of things but I am getting #error or #name.
I am using
=(DLookUp("ProductName","List","ProductN=" & [Textbox#1] & "'"))
Please help me find the solution for it.
Thank you,
regards,
Rohan
ProductN is probably text, so try inserting the missing quote:
=DLookUp("ProductName","List","ProductN = '" & [Textbox#1] & "'")

SSRS not recognizing dataset in expression for barcode

Whenever I use this code
=IIf(JPCI_RPT_ReceiptStatusHeaderBLW.RECEIPT_ID_TYPE = "Trailer ID",
Code.StringToBarcode({JPCI_RPT_ReceiptStatusHeaderBLW.trailer_id}),
Code.StringToBarcode({JPCI_RPT_ReceiptStatusHeaderBLW.receipt_id_type}) & chr(10) &
Code.StringToBarcode({JPCI_RPT_ReceiptStatusDetailsBLW.item})
I get the following error...
Name 'JPCI_RPT_ReceiptStatusHeaderBLW' is not declared.
It's checking for dataset right? If not, how do I declare it?
The expression is looking for a field name and you're converting something like Crystal Reports to SSRS. In SSRS you refer to a field value with Fields!FieldName.Value.
Assumeing that you have a dataset with necessary fields, your expression would be something like:
=IIF(Fields!RECEIPT_ID_TYPE.Value = "Trailer ID",
Code.StringToBarcode(Fields!trailer_id.Value),
Code.StringToBarcode(Fields!receipt_id_type.Value) & chr(10) &
Code.StringToBarcode(Fields!item.Value) )
You had missed a closing parenthesis as well, but the error check didn't get that far.

Function DLookup in Ms Access 2016

gives me
when saving records in the system.
Can anyone let me know what is the problem in this?
xx = DLookup("[part_number]", "tblModelCost", "[Customer_ID]= " & me.Customer_ID & " and [Model] = '" & me.[txtModel] & "' and [Description] = 'screen'")
Looks like Me.Customer_Id should be Me!Customer_Id. However, that depends on the form control name and what you are trying to do. Assuming you have a control named "Customer_ID" and a field named "Customer_ID" Me.Customer_ID will try to use the the control value, me!Customer_ID will try to use the underlying bound field value. If you don't have a control named Customer_ID then using Me.Customer_ID will cause the error you are getting. (This is why you want to learn to use controls names like txtCustomer_ID for your controls. )

Open Form to specific record

I'm struggling with a code I found on Stackoverflow. It keeps on telling me:
run-time error "424: object required".
I want to double-click on a record within a list box to open a form to the specific record clicked. The value from the record that I need the form to navigate to is found in Column 1 of the list box.
List Box Name: frmDashboardJBCreate
Field name in the table: JobcardNumber (numeric field)
Form Name: frmJobcardCreate
Table Name: tabJobcard_Issue
The code I tried is the following; but it keeps on giving me the error mentioned above:
DoCmd.OpenForm "frmJobcardIssue", , , _
"[JobcardNumber] = '" & Me.frmDashboardJBCreate.Column(1).Value & "'"
Could you please assist me?
If JobcardNumber is numeric, don't use single quotes around the parameter.
ListBox.Column() is zero-based, so if you want the first column, it's
DoCmd.OpenForm "frmJobcardIssue", , , _
"[JobcardNumber] = " & Me.frmDashboardJBCreate.Column(0).Value
Note: frm usually stands for "Form", so it is rather confusing if you name a listbox frmDashboardJBCreate. Are you sure you have that name right?

how do I show the parameters of a report in a textbox on the report?

I have a date range as parameters on my report, #dt_begin and #dt_end.
On the header of the report I would like to display "report run from #dt_begin to #dt_end".
with the actual date values in it, example:
"Report run from 14-Oct-2013 to 16-Oct-2013".
How can I do that?
thanks and regards
Marcelo
In expressions, refer to parameter values using Parameters!param.Value.
In your example, add an expression similar to this to a textbox in the header:
="Report run from " & Format(Parameters!dt_begin.Value, "dd-MMM-yyyy")
& " to "
& Format(Parameters!dt_end.Value, "dd-MMM-yyyy")
All it's doing is formatting your parameters and adding them to a larger string.