I want to ask how can I add ID variable to URL adress in my table. Bellow you can see what I mean. Now I have table with columns. First column is an ID and in another column I have URL adress (field is text type). I need to get ID variable to URL address for example like that. https://website.com/images/[ID]/main.jpg
[ID] is a variable what I need to get there.
LINK TO IMAGE: CLICK
That will be:
=Replace([Mainimageforsolution],"[ID]",[ID])
To replace series of [ID]:
=Replace("https://etiweb.samuelmarcinko.com/images/[ID]/1.jpg" & "|" & "https://etiweb.samuelmarcinko.com/images/[ID]/2.jpg" & "|" & "https://etiweb.samuelmarcinko.com/images/[ID]/3.jpg" & "|" & "https://etiweb.samuelmarcinko.com/images/[ID]/4.jpg" & "|" & "https://etiweb.samuelmarcinko.com/images/[ID]/5.jpg" & "|" & "https://etiweb.samuelmarcinko.com/images/[ID]/6.jpg", "[ID]", CStr([ID])
Related
I am trying to creating a MS Access form, where a user would input comments in a text box (Input), and the text would be appended each time to a summary box which would be greyed out and is non editable.
The Input comments will be auto formatted to include the date timestamp and username using the following code:
Private Sub IncidentDescriptionInput_AfterUpdate()
Dim Output As String
Output = Me!IncidentDescriptionInput.Value
Output = Output & " " & Format(Now(), "dd-mmm-yy") & "/" & Format(Now(), "hh:nn") & "/" & Environ("UserName") & ";"
Me!IncidentDescriptionInput.Value = Output
End Sub
Your current code already demonstrates the techniques required to achieve your goal:
Updating the value held by a form control as part of the event handler for the AfterUpdate event. You already do this in your existing code with Me!IncidentDescriptionInput.Value = Output
Retrieving the existing value of a form control for concatenation with another string. You already do this in your existing code with Output = Me!IncidentDescriptionInput.Value
Concatenating the existing value of a form control with another string. You already do this in your existing code with Output = Output & " " & Format(Now(), "dd-mmm-yy") ...
And so, you already have the building blocks required to achieve the desired result.
Assuming that the summary box is called IncidentDescriptionSummary, then the code might be modified to something like:
Private Sub IncidentDescriptionInput_AfterUpdate()
Dim Output As String
Output = IncidentDescriptionInput & " " & Format(Now(), "dd-mmm-yy\/hh:nn\/") & Environ("UserName") & ";"
IncidentDescriptionInput = Output
IncidentDescriptionSummary = IncidentDescriptionSummary & vbCrLf & Output
End Sub
My table is tbl_WCCSRQA, the relevant fields are CustomerServiceRep and Claim Date.
My form that passes the variables is called frm_CSRErrorTracking, and the relevant boxes are called CSRNameCB (a combo box), and StartDate EndDate (both are text boxes)
My report is called rpt_CSRErrorTracking and I want to set the DCount as a control source for a textbox called TotalClaims
I need a DCount that counts all instance of a CustomerServiceRep name between two dates. I'd like to pass the Name and Dates from my form. I'd like to set the DCount as a control source for the textbox on the report
Here is the DCount I have tried so far;
=DCount("CustomerServiceRep", "tbl_WCCSRQA", "CustomerServiceRep = '" & [Forms]![frm_CSRErrorTracking]![CSRNameCB] & "'" AND "ClaimDate = '" BETWEEN [FORMS]![frm_CSRErrorTracking]![StartDate] AND [FORMS]![frm_CSRErrorTracking]![EndDate]"'"
I've looked at this for the past 30 minutes and cannot figure out where I am going wrong. I continue to get the error message "You may have entered an operand without an operator".
You have a few double quotes out of sync - try the following:
=DCount("CustomerServiceRep", "tbl_WCCSRQA", "CustomerServiceRep = '" & [Forms]![frm_CSRErrorTracking]![CSRNameCB] & "' AND ClaimDate BETWEEN #" & Format([FORMS]![frm_CSRErrorTracking]![StartDate],"yyyy-mm-dd") & "# AND #" & Format([FORMS]![frm_CSRErrorTracking]![EndDate],"yyyy-mm-dd") & "#")
I have 2 datasets from which I populate my report, ActiveProjects (primary dataset) & ActiveTasks. I use the expression:
=Join(lookUpset(Fields!Title.Value, Fields!Related_Project.Value, "" & Fields!Title.Value & "", "TeamTasks"), "<br> <br>")
This works great for retrieving each task grouped with its related project and it also includes a dynamic URL to the respective tasks.
My question is: Is it possible to include additional pieces of information (such as TargetDate - which is in the ActiveTasks Dataset) to be placed alongside the Task in the same Column & Row (Otherwise it wont remain aligned as the Task list goes on, since they are of varying length, while the date is not) ?
Ideally, it would return something like this:
Project Title Task Title
_______________|_________________
Project A | Task a 12/12/16
| Task b 02/12/16
| Task c 28/11/16
Project B | Task a 22/11/16
|
Thanks in advance and sorry if this has been addressed before!
Try:
=Join(
lookUpset(
Fields!Title.Value, Fields!Related_Project.Value,
"<a href = " & Chr(34) & "https://example" & Fields!ID.Value & Chr(34) &
">" & Fields!Title.Value & "</a>" & " " & Fields!TargetDate.Value , "TeamTasks"
),
"<br> <br>"
)
Also you may want to format your date, so you can use FORMAT(Fields!TargetDate.Value,"dd/MM/yyyy") inside a LookupSet function.
It is not tested but should work.
Let me know if this helps.
An example is trying to combine first name and last name into fullname from a table thats called employee. What expression do I type in the Control Source? I've typed FullName: [First] & " " & [Last] but it kept saying error.
=[First] & " " & [Last]
Should do it.
To avoid complications with nulls use:
=Nz([First], "") & " " & Nz([Last], "")
I have a combo box on a form that searches for records on the form. It Works fine However, I wanted to modify the after update event macro so the Where Condition matches 2 fields in the same record where both fields are represented by two column in the same combobox.
this is what I have
Where Condition=="[WorkDate] = " & "#" & Format([Screen].[ActiveControl],"mm/dd/yyyy") & "#"
I want to modify this combobox to search for both [WorkDate] and another text field called [WorkType].
I have gone ahead and do a combobox search for the [WorkType] field and got this
Where Condition=="[WorkType] = " & "'" & [Screen].[ActiveControl] & "'
any help on how to merge these search criteria would be much appreciated
Since your data are in one combobox but your search criteria are in different columns you can construct your query like this
combobox columns: WorkDate | WorkType | Comment
"[WorkDate] = " & "#" & Format(cboYourComboBox.column(0),"mm/dd/yyyy") & _
"# and [WorkType] = " & "'" & cboYourComboBox.column(0) & "'"
If you no longer use Screen.ActiveControl you can use this same code for the AfterUpdate event of both comboboxes.