Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I use Data Modules?

Status
Not open for further replies.

grwd

Technical User
Jan 20, 2002
20
US
I have a form with a dbgrid, memo and a button. (Unit = main)
I also have a data module with a table (Paradox) and datasource. (unit = dm1)

I want to do three things:
1. display contents of table in dbgrid.
2. on datasource.updatedata and datasource.change I want to update a concantinated string of table data in the memo.
3. on button.click I want to place a lock on the table.

Problem: 1 & 2 seem to require that the dm1 Uses: includes main. However, 3 seems to require that main Uses: includes DM1.

How can the data module be used when events are being triggered from both the form and the data module?
 
grwd,

The Form should use the DataModule. This will let you bind the data controls on the Form to the data access controls in the DataModule (that's #1).

For #2, pull the memo data from the underlying tFIeld containing the memo data. If you're not storing the memo in an actual field, you can fake it using a calculated field.

You should be able to do #3 after you use the DataModule in the form by simply setting the Table object's Exclusive property to TRUE in your button's OnClick event.

Hope this helps...

-- Lance
 
The datamodule is a container for non visual components.
If you put a Table or Qoery on the datamodule, it is a available for other forms, simply by using in your form uses Dm1.
You are not restricted to tables or queries but all other non-visual components like ImageList, global variables, stringlists etc..

Regards Steven van Els
SAvanEls@cq-link.sr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top