?
Solved

Query Query

Posted on 2002-07-25
26
Medium Priority
?
227 Views
Last Modified: 2012-05-05
Hi experts,

I have created a Master/Detail form for Customers/Invoices using 2 grid components.
I want to add a button to open another form to show the selected invoice (so it can be edited).
How do I pass the Invoice Number (filedname 'ID') to the other form and display the information?

Any help would be appreciated.
Thanks
Freerider.
0
Comment
Question by:Freerider
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
26 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7178481
multiple possibilities, but too tired, listening  . . .

0
 
LVL 3

Expert Comment

by:marcoszorrilla
ID: 7178565
Why not use a Filter
MyInvoiceNumber.Value:=xxxxx;
MyInvoice.Filtered:=True;

And then show the invoice with the Data Aware Controls as Dbedit .... in the other form.

Application.CreateForm(TMyInvoiceForm, MyInvoiceForm);
MyInvoiceForm.ShowModal;

Best Regards.
Marcos.

0
 
LVL 2

Accepted Solution

by:
alsantos earned 400 total points
ID: 7178909
Freerider

Normally, the invoice number is the field[0] so put this on the dbgrid:

"ondbclick" event of the new form:

 after create the new form do this:
 
 newform.edit1.text:=MainForm.dbgrid1.Fields[0].Text;
 newform.edit2.text:=MainForm.dbgrid1.Fields[1].Text;

 and show the newform,

so, the newform will show the selected information.
 
alsantos
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Expert Comment

by:trex_fire
ID: 7179146
Or add the property InvoiceNumber to your form and assign it before showing it.  Then, when you're back, you can validate it or follow the course of action you want.

T-Rex
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7179274
it goes simpler, later, just waked up
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7179322
back again, with a cup of coffee :-)

well, i would drop a datasource on your invoiceform and let point the dataset-property to the invoicetable of your mainform, thats all

meikl ;-)
0
 
LVL 7

Expert Comment

by:God_Ares
ID: 7179462
Good Morning kretzschmar, and how's the coffee 4 u?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7179467
>and how's the coffee 4 u?
strong, as recommended ;-)
0
 
LVL 8

Expert Comment

by:TOndrej
ID: 7181359
The spice must flow ;-)
0
 

Author Comment

by:Freerider
ID: 7181706
kretzschmar,
I tried your suggestion and it works (If I use a DBGrid), but I want to use DBEdit components so I can arrange them properly on the form - when I do this I only get the first record.

They *are* pointing to the correct datasource.
What can be wrong??
-Freerider
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7182092
>do this I only get the first record.
not really,
the form should display the current record,
which is selected in the childgrid of your mainform

if you want to scroll, within this form,
just place a tdbnavigator on the form,
and connect its datasource-property
to the datasource on the form

if needed, i could code a little sample,
and send it to you (mail-adress required)

hope this helps

meikl ;-)
0
 

Author Comment

by:Freerider
ID: 7182357
kretzschmar
>not really,
I *do*!!!??

>the form should display the current record,
I have both the DBGrid and the DBEdit fields on the same form. The DBGrid shows the current record as expected.
They are pointing to the same Dataset - I've checked it a hundred times!
 
A sample would be great:
andrewKEEPYOURSPAMgreaney@snowboard.com

Thanks.

0
 

Author Comment

by:Freerider
ID: 7182361
I mean DataSource.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7183143
one day later, early in the morning, with a cup of coffee :-))

sample in work

meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7183212
sample on the way ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7183226
mailing failed :-(

validate your given mail adress
0
 

Author Comment

by:Freerider
ID: 7183906
Sorry,

did you take out KEEPYOURSPAM ??
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7183912
no, what to use instead?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7184735
where should i now send it instead?
0
 

Author Comment

by:Freerider
ID: 7184911
OK,
can you send it to:

andrewgreaney@libero.it

Thanks.
0
 

Author Comment

by:Freerider
ID: 7215209
kretzschmar,

I still haven't received your sample.
Did you manage to send it ok?

Freerider.
0
 

Author Comment

by:Freerider
ID: 7215215
kretzschmar,

I still haven't received your sample.
Did you manage to send it ok?

Freerider.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7215342
>Did you manage to send it ok?
just now :-)

sorry, for delay

meikl ;-)
0
 

Author Comment

by:Freerider
ID: 7223651
Thanks meikl,

I got it to work (using an Access database) - sort of. The only problem is when I open the invoice on a new form, I can't edit the data.

I need to check to see which Table I'm accessing, or do I need to set an option for editing somewhere?...

Freerider.
0
 

Author Comment

by:Freerider
ID: 7264822
I eventually used the method suggested by alsantos , but want to split the points as meikl's sample was also very helpfull. How do I split points??
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7265073
ask at community support for splitting points ;-)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question