Bringing the Access 'Set.Focus' Logic to Knack: A Data Entry Enhancement

Hi everyone,

I’ve been developing in Knack since 2016, and if there is one thing that still bugs me, it’s having to manually click into a field every time a modal or page loads. When you are doing high-volume data entry, those extra clicks really add up!

I’m the first to admit I’m not a “pro coder”—I’m a legacy VB / Microsoft Access guy at heart . Back in the day, we just used Set.Focus, but it’s a bit more “involved” in a web environment.

I’ve put together a short video showing a workaround to automatically set the focus to any field when a form renders or after a record is submitted.

Important Note: This solution is specifically for Knack Classic.

The Secret Sauce: jQuery Selectors The trick is using specific jQuery selectors to find exactly where the cursor needs to land. This is easy for standard fields, but gets tricky with complex ones. In the video, I show how.

There’s likely a more ‘pro’ way to update this universally, but this method works every time. Not bad for an old guy with a bit of help from AI! :wink:

3 Likes

Happy New Year Carl

Little off topic but is there anyway to make Knack screens go horizontally between fields instead of vertically ?

Find it bloody annoying when you have 3 data fields across the pagevand it insists on going column by column.

Cheers

I presume you’re referring to the “tab order”?

Back in the day (Microsoft Access) this was an easy thing to change, but I’ve not looked into how this would be possible with code. :technologist:

Don’t forget, I’m not a coder :joy:

Yes exactly what I was referring to.

Maybe something the chap who does the wonderful toolkit could look into maybe !!!

Get BlueMail for Android

I spoke with @NormandDefayette_CortexRD the other day and I know he is busy on project work.

Ray, set up the form so the rows are each a group. I.e set your first three fields horizontally then pull the fourth field down until the separator spans the whole page. Then fill out that row and do the same with next field to start another new group. And so on. Then it will tab across and then down …

Its well demonstrated here by Stephen Chapman: Can I control the sequencing order for tabbing from field to field on a form? It seems to default to top to bottom for each columns of data fields - #3 by StephenChapman

That will space out the rows a little vertically (as the groups are slightly spaced out) buts its likely that CSS might be able to push them back tighter if it was an issue …