Fetch Value from Subform selection

ravikiran

New member
Local time
Today, 02:24
Joined
Oct 19, 2015
Messages
4
Hi Gurus,

I request your help with an issue. :banghead:

I am building an application for a Doctor friend. As show in the below screenshot I have 3 Forms (screenshot attached instead):
  1. frmSearchPatient
  2. frmPatientInfo
  3. subformSearchResults (acts as subform in frmSearchPatient)

My interest is to do the following 3 tasks:
  1. do a search based on the parameters entered and update the subform with query results (as seen in the screenshot).
  2. Be able to doubl-click on the record, which opens it in frmPatientInfo form.
  3. Click on the button "Add Patient", which adds the selection to the List box above.

I am able to achieve the 1st task and update the Subform on frmSearchPatient, but am unable to fetch the selected record to accomplish 2nd and 3rd tasks. Please guide me on this.

Your help is greatly appreciated!

Thanks in advance,
Ravi.
 

Attachments

  • Screenshot.png
    Screenshot.png
    57.3 KB · Views: 68
I might be more likely to use a listbox rather than a subform. A subform is nice when you have a one-to-many relationship between the parent form's record, and multiple related child records, but you are just running a search here, right? A subform provides all kinds of overhead you don't need, and a listbox lets you handle user interaction in the main form's module. And it's easy to handle the list's Click or DblClick event, and so on, and so on, . . .

As your user updates the search parameters, update the listbox's RowSource property with an updated SQL statement, notably, update the SQL statement's WHERE clause to provide the filter your user is creating.
 
Hi Mark,

That's a fast reply :) Thanks!

I did think about having a list box when I am struck with the subform. Actually it is still there but hidden out of view :)

The only reason went back to crack the subform is due to the design element. It is more usable and has a good look and feel compared to a multi-column List box.

I am not entirely satisfied, how it looks. And the option to customize the look and feel isn't much. Or am I missing something on "How to format a list box?"
Please suggest.

Updated Screenshot attached.

Thanks again,

Cheers,
Ravi.
 

Attachments

  • Screenshot1.png
    Screenshot1.png
    62.9 KB · Views: 71
Obviously the choice is yours, and I agree the subform is prettier, but it's harder to update with the user's search terms, harder to capture the users click, and offers tons of features to distract your user from the task at hand, which is only this: search for and select a single record.

Simplify. What is your exact purpose with this user interface element? Why offer more features here than that purpose requires? Your call,
 

Users who are viewing this thread

Back
Top Bottom