Find record from pop up form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Thanks to Steve Schapel I have been able to create a query and pop up form
that opens on a date condition criteria. Opening my 'Product' form the pop up
form ('Notification') opens and lists a number of records fitting the
criteria.
What I want to do now is to find those selected records from the pop up form
on the 'Product' form.
Steve had given me 6 steps to doing the whole process but I'm stuck on #6,
which is:
6. Make another macro to assign on the Click event of a command button
on the popup form, probably using the FindRecord action, to select the
required record and then close the popup form.
The name of the field that we would be looking for is StyleID.
Any help greatly appreciated as always.
 
Graeme,

If the popup form shows the records in continuous view, you will need to
put the command button in the Detail section of the form, so you see an
instance of the button for each record.

The macro will be something like this...

Action: SelectObject
Object Type: Form
Object Name: Product
In Database Window: No

Action: GoToControl
Control Name: [StyleID]

Action: Find Record
Find What: =[Forms]![Notification]![StyleID]
Other arguments as per defaults

Action: Close
Object Type: Form
Object Name: Notification

I didn't test this, so let us know how you get on.
 
Thanks Steve,
it works just fine. (Once I realised that it should be assigned to the "On
click" event!)

Any suggestions as to how I can resize the pop-up window? I don't want it to
maximise on opening. Tina has tried to help but does not seem to work.
(Do.Cmd Restore)

Cheers, Graeme

Steve Schapel said:
Graeme,

If the popup form shows the records in continuous view, you will need to
put the command button in the Detail section of the form, so you see an
instance of the button for each record.

The macro will be something like this...

Action: SelectObject
Object Type: Form
Object Name: Product
In Database Window: No

Action: GoToControl
Control Name: [StyleID]

Action: Find Record
Find What: =[Forms]![Notification]![StyleID]
Other arguments as per defaults

Action: Close
Object Type: Form
Object Name: Notification

I didn't test this, so let us know how you get on.

--
Steve Schapel, Microsoft Access MVP
Thanks to Steve Schapel I have been able to create a query and pop up form
that opens on a date condition criteria. Opening my 'Product' form the pop up
form ('Notification') opens and lists a number of records fitting the
criteria.
What I want to do now is to find those selected records from the pop up form
on the 'Product' form.
Steve had given me 6 steps to doing the whole process but I'm stuck on #6,
which is:
6. Make another macro to assign on the Click event of a command button
on the popup form, probably using the FindRecord action, to select the
required record and then close the popup form.
The name of the field that we would be looking for is StyleID.
Any help greatly appreciated as always.
 
Thanks Steve,
Is it possible to keep the pop up form open (i.e. exclude the 'Close'
action) and work on the 'Product' form at the same time?
I tried by just deleting the 'Close' action but find that I cannot update
any fields unless I close the pop-up form.

Graeme

Steve Schapel said:
Graeme,

If the popup form shows the records in continuous view, you will need to
put the command button in the Detail section of the form, so you see an
instance of the button for each record.

The macro will be something like this...

Action: SelectObject
Object Type: Form
Object Name: Product
In Database Window: No

Action: GoToControl
Control Name: [StyleID]

Action: Find Record
Find What: =[Forms]![Notification]![StyleID]
Other arguments as per defaults

Action: Close
Object Type: Form
Object Name: Notification

I didn't test this, so let us know how you get on.

--
Steve Schapel, Microsoft Access MVP
Thanks to Steve Schapel I have been able to create a query and pop up form
that opens on a date condition criteria. Opening my 'Product' form the pop up
form ('Notification') opens and lists a number of records fitting the
criteria.
What I want to do now is to find those selected records from the pop up form
on the 'Product' form.
Steve had given me 6 steps to doing the whole process but I'm stuck on #6,
which is:
6. Make another macro to assign on the Click event of a command button
on the popup form, probably using the FindRecord action, to select the
required record and then close the popup form.
The name of the field that we would be looking for is StyleID.
Any help greatly appreciated as always.
 
Graeme,

I'm not 100% sure of the problem here. If you mean that the pop up form
is literally a popup form, i.e. its Popup property (or Modal property
for that matter) is set to Yes, then I don't think you will be able to
work on the Product form until the Notification form is closed. It may
be as simple as setting these properties to No.

Another approach may be to use a SetValue action to set the Visible
property of the Notification form to No, instead of the Close action.
This will hide it instead of close it.

What actually is your purpose in wanting to retain the Notification form
open?
 
Steve,
as there are a number of records that meet the criteria on the pop up
(Notification) form and we need to revert to the Product form to update data,
we want to keep the Notification form open.
I had set up the modal property to pop-up, so I have changed that now, but
it still does not work.
Not sure how to write SetValue action.

Cheers,

Graeme
 
Graeme,

I am not sure what "set up the modal property to pop-up" means. THe
form has a Modal property and a Popup property. Both of these
properties can be set to Yes or No. In this case, my suggestion was
that they both would need to be set to No - is that what you have?
 
Thanks Steve,
hah, the modal property was set to yes.
seems better now, although the other form ('Product') is the one that is
visible (i.e. both the 'Notification' and 'Product' forms open).
I'll try and figure it out.
Cheers,
Graeme
 
Graeme,

That's what I thought you wanted - both forms open at the same time,
able to switch form one to the other, and the Notification from still
open when the Product form is closed.
 
Steve,
you're right but I wanted the Notification form to take precedence (if that
makes sense?). i.e. to open over the Product form.
Also not sure how to do this: " Another approach may be to use a SetValue
action to set the Visible property of the Notification form to No, instead of
the Close action. This will hide it instead of close it. "

Thanks again,
Graeme
 
Graeme,
you're right but I wanted the Notification form to take precedence (if that
makes sense?). i.e. to open over the Product form.

I'm not sure what is going on here. That is what I would have expected
to happen anyway, i.e. if you have the Product form open, and then open
the Notification form, the Notification form would be "on top of" the
Product form (unless you have space on the screen for both).

You can use the SelectObject action in a macro to force a form to have
the focus.
Also not sure how to do this: " Another approach may be to use a SetValue
action to set the Visible property of the Notification form to No, instead of
the Close action. This will hide it instead of close it. "

Action: SetValue
Item: [Forms]![Notification].[Visible]
Expression: No
 
Back
Top