Jump to content

How To: opening form based on formnames stored in database


mierlp

Recommended Posts

Hi,

My application contains around 90 tables for lookup use. Because I do not want to put this in a menu - it is getting too large,
I want to do this in a database.The user sees a dbgrid with 2 columns:
- table name as I would in the menu, for example, Type Payment
- explanation in the form of a short sentence  

When the user double clicks on a line, the screen must be opened.In the database I save:
- FormName (formTypePayment) or frmTypePayment (file name)
- how to open 'show' or 'showmodal'

So the form is already part of the application and normally I would call it FormTypePayment.show as follows
 

How can I do this based on the data in the database?

Link to comment
Share on other sites

Hi Hayri

The code works great ...but is there a way to use the show or showmodal also from database. 
Every records contains the formname and the way how to show the form, this is a string field

How can i use:

Form.+table.fieldbyname('howtoshowform').asstring; 

that it will show the form

 

Link to comment
Share on other sites

i need to pas the string of the datasebase field showform (it can be show of showmodal)

to the FORM.

But something like this is not working

Form.+table.fieldbyname('howtoshowform').asString;

or

Form+'.'+table.fieldbyname('howtoshowform').asstring;

or with

quotedStr(table.fieldbyname('howtoshowform').asString

i can do something like this but there must be a more elegant way

if table.fieldbyname('howtoshowform').value = 'show' then
   form.show
else
  form.showmodal

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...