Getting selected record from "Search Part" pop up form to main form (1 Viewer)

Linda1503

Member
Local time
Today, 03:06
Joined
Sep 3, 2021
Messages
77
Hi, I have a main form for creating/editing an order, a pop up subform for adding a product to the order and from there a pop up form to search part of the product name if they're not sure what Prod Type to use to filter to the appropriate product - the Search Part pop up is of necessity in datasheet view - the user would look at the available options and select best option - at the moment they then have the filter name to enter into the Add Product subform.
Any advice on how I would pass the selected record to the Add Product subform? More efficient than them having to enter it...
 

Linda1503

Member
Local time
Today, 03:06
Joined
Sep 3, 2021
Messages
77
search.JPG
 

Gasman

Enthusiastic Amateur
Local time
Today, 03:06
Joined
Sep 21, 2011
Messages
9,582
You could use a double click event on the Product Search form to set the controls on your main form?
 

Linda1503

Member
Local time
Today, 03:06
Joined
Sep 3, 2021
Messages
77
Thanks Gasman :) but probably better using a button - butchers have fat fingers :) and it's for use on a tablet. How do you refer to the currently selected record in vba? Sorry I'm a zilch coding wise :-/
 

mike60smart

Registered User.
Local time
Today, 03:06
Joined
Aug 6, 2017
Messages
1,047
Your Form does not look right for adding Products to an Order?

Do you currently add 1 Product at a time? Usually this process is managed by a Form that allows you to select a Customer.
With a Subform to enter the Order Number & Order Date
With another Subform for entering 1 or more Products to the Order.
 

mike60smart

Registered User.
Local time
Today, 03:06
Joined
Aug 6, 2017
Messages
1,047
As asked in my previous question, Why have a Main Form linked to a Subform that only allows 1 Product to be entered.

A far simpler process would be the Mainform linked to a subform set to Continuous View which allows more than 1 record to be added.
 

Gasman

Enthusiastic Amateur
Local time
Today, 03:06
Joined
Sep 21, 2011
Messages
9,582
Thanks Gasman :) but probably better using a button - butchers have fat fingers :) and it's for use on a tablet. How do you refer to the currently selected record in vba? Sorry I'm a zilch coding wise :-/
Hmm, not sure how that would work on a tablet, so as you say Button probably needed?
I was just thinking of hardcoding the form name
Code:
Forms!YourMainForm.ProductName = Me.ProductName

Something along those lines?
 

Linda1503

Member
Local time
Today, 03:06
Joined
Sep 3, 2021
Messages
77
The one at a time method of entering products helps with having space for product notes (each item is prepared to order), questions, the search function (they have a lot of products), the kg to lb button, still leaving space for the pop up keyboard on the tablet (no space for attached keyboard when they're busy and it would get incredibly mucky!) - it's very quick - just save and new and the full list is shown on the main order form. All controls have to be of a useable size for big fingers...
 

Linda1503

Member
Local time
Today, 03:06
Joined
Sep 3, 2021
Messages
77
Hmm, not sure how that would work on a tablet, so as you say Button probably needed?
I was just thinking of hardcoding the form name
Code:
Forms!YourMainForm.ProductName = Me.ProductName

Something along those lines?
But
Give them a stylus :)
Tried that but it's not that great tbh - more responsive to fingers - cheap tablet with generic screen protector (only one available) & not very responsive... & they'd loose the stylus :)))
 

mike60smart

Registered User.
Local time
Today, 03:06
Joined
Aug 6, 2017
Messages
1,047
Each to their own but my suggested layout is just a suggestion and in my opinion would make life far easier for Fat Fingered Butchers.
 

Linda1503

Member
Local time
Today, 03:06
Joined
Sep 3, 2021
Messages
77
Hmm, not sure how that would work on a tablet, so as you say Button probably needed?
I was just thinking of hardcoding the form name
Code:
Forms!YourMainForm.ProductName = Me.ProductName

Something along those lines?
Would that automatically see the selected record?
 

Linda1503

Member
Local time
Today, 03:06
Joined
Sep 3, 2021
Messages
77
Each to their own but my suggested layout is just a suggestion and in my opinion would make life far easier for Fat Fingered Butchers.
Thank you for input but that's the format I have for order input from the office & it just doesn't work on the tablet...
 

Gasman

Enthusiastic Amateur
Local time
Today, 03:06
Joined
Sep 21, 2011
Messages
9,582
So did productid appear with intellisense when you typed it? You have to get the names correct.
 

Linda1503

Member
Local time
Today, 03:06
Joined
Sep 3, 2021
Messages
77
Intellisense doesn't seem to be switched on (no idea how) but I copy the field names to notepad and paste from there - the name's okay but could it be that Me. is not recognising it as referring to the ProductID of the selected record in the datasheet?
 

Gasman

Enthusiastic Amateur
Local time
Today, 03:06
Joined
Sep 21, 2011
Messages
9,582
Remove the ProductID and the full stop and reenter the full stop.
Not even sure how you switch intellisense off TBH, nor why :)

Here are my Options
1633870676968.png
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 22:06
Joined
May 21, 2018
Messages
5,902
Not even sure how you switch intellisense off TBH, nor why
Probably not switched off, but if the code will not comply because there are other errors somewhere it will stop working.
Hit Debug > Compile to fix all errors first.
 

Users who are viewing this thread

Top Bottom