Hyperlink in report to open form.

dwcrockford

New Member
Joined
Sep 1, 2015
Messages
27
Access 2013

I have designed a form for invoicing - it is set to begin a new record on open.

I have also designed a report which outlines invoices (all or outstanding).

On the report, I have given the "InvNo" a hyperlink format, and assigned an "on click" macro to it that opens the Invoice Form to the selected record. The macro code is

Where Condition: ="[InvNo]=" & [InvNo]
Data Mode: Edit
Window Mode: Dialog

The coding works with one exception. When it opens the form, it goes to "new record", and display results 2 of 2 in the bottom left of the window. If I click "back" arrow, it takes me to the hyperlinked record in the form (the one I wanted). What code am I missing in the macro to disable the "new" part of the form and go directly to the requested record. Can this be done without disabling the "new" on startup of the form when it is used by itself?

D.

Thanks
 
That solution was designed for an invoice number which would not present the problem you now have. The easiest solution is to remove the apostrophe, either as a user inputs the data, or after. The assumption is that Its, although not grammatically correct, would not be objectionable. This could be done with the Replace function: Replace (string1, find, replacement, [start], [count], [compare]). Start, count and compare are optional.

However, if you cannot, you are faced with a difficult situation in that a title can have more than one apostrophe. So in my mind you are looking at a function that uses some combination of Inst, Mid, Len and maybe Replace functions that builds a complicated concatenated string using ASCII codes. You would likely need this function to loop as well.
Something like
"It" & Chr(39) & "the Most Wonderful Time of the Year"
The function would have to insert the inner quotes as needed. Doing without the apostrophe in the title might not look so bad now?
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,221,834
Messages
6,162,268
Members
451,758
Latest member
lmcquade91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top