Open another form based on ID if no records

Elmobram22

Registered User.
Local time
Today, 18:18
Joined
Jul 12, 2013
Messages
165
Hi all,

I'm working on a database for residents at a care home. I've just started and I want to automate a process where I can click a button and see the contact details of a GP. It's all working but I want it to be that if the resident has no GP it will open a form so you can choose a GP. I have a message box to tell the that the resident has no GP and it takes them to the relevant form but I need it to be based on the correct residents ID and it is not. I have the code running on form load. I think this is where I am going wrong. Any help would be greatly appreciated. I have attached a zipped version of the database (it is safe I promise)

Cheers,

Paul
 

Attachments

Sorry - I look at you database, but this closing forms and minimizing irritated
me so that I shot down the database. :(
Plus you didn't mention how to reproduce the fault.
 
Hi,

Sorry about that. I have now removed the auto minimize stuff to make it easier to play with. Basically when the main form opens [FrmResident] if you select a resident from the drop down and press "View GP Details". If they have a GP it'll show you the info. If not you'll get a message box saying there is no GP and it opens [FrmChooseGP] but not based on the correct resident.

Thanks,

Paul
 

Attachments

There are some main fault in the way you do it, (database attached):

  1. You are not transferring the ResID between the forms.
  2. You are not writing back the fkGB when you choose in FrmChooseGP
  3. The combobox in FrmChooseGP need to be unbound
Only a personally note, I wouldn't do it in that way, it is to time consuming all this open/closing forms and confusing also.
 

Attachments

Thanks for the reply and the work you've done. Guess I'll look into openargs as I've never used that before. Also as you said you wouldn't do it this way, what would your suggestion be? All the work I've done has been in this way with opening and closing forms.
 
Thanks for the reply and the work you've done. Guess I'll look into openargs as I've never used that before. Also as you said you wouldn't do it this way, what would your suggestion be? All the work I've done has been in this way with opening and closing forms.
Let them stay open then you come back to exact same record, open and closing forms unnecessary make most users confused and is time consuming if you've to put in many data at once.
And then use subforms!
View data in a continues form etc.
Maybe look at different databases (other applications), how other do it, for getting ideas.
 

Users who are viewing this thread

Back
Top Bottom