AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein Access variable from one form to another
Thema durchsuchen
Ansicht
Themen-Optionen

Access variable from one form to another

Ein Thema von question · begonnen am 20. Aug 2013 · letzter Beitrag vom 26. Aug 2013
Antwort Antwort
question

Registriert seit: 17. Apr 2013
97 Beiträge
 
#1

AW: Access variable from one form to another

  Alt 26. Aug 2013, 17:33
Hi,
i have followed what you have suggested but i still got the value '0' .
Now, i wanna do the work in same Unit mot from another
Code:
Procedure TForm1.AddDateTime(Sender:Tobject; AEvent: TcxSchedulerEvent);
begin

Query.Close();
    QueryKalender.SQL.Text:= 'INSERT INTO Table'
      '(Name`, `NEWID` ..) ' +
    'VALUES ( ' :Name, :NEWID);';

Query.ParamByName('NEWID').AsInteger:= AEventID;
    Query.ExecSQL();
    Query.Close();

  end;

Procedure TForm1.OnDragDrop(Sender, Source: TObject; X,
  Y: Integer);

begin
//here i would like to use the value of AEventID;
//i cannnot call the procedure AddDateTime(Sender,TcxSchedulerEvent);
//becasue the parameter is different, how can i overcome it ?
end;

Geändert von question (26. Aug 2013 um 17:50 Uhr)
  Mit Zitat antworten Zitat
question

Registriert seit: 17. Apr 2013
97 Beiträge
 
#2

AW: Access variable from one form to another

  Alt 26. Aug 2013, 22:19
Hi, now its working fine i have written the follwoing
Code:
procedure TForm1.SetMyPersonID(AValue: Integer);
begin
  FQuery.FieldByName('MyPersonID').AsInteger := AValue;
end;

procedure TForm1.GetMyPersonID: Integer;
begin
  Result := FQuery.FieldByName('MyPersonID').AsInteger;
end;
is that ok to write like this, i mean normally in sql query need to query.sql.add/query.sql.open/close... but in this case it is working fine should i need to write the whole query or is that also okay just to write only
Code:
Result := FQuery.FieldByName('MyPersonID').AsInteger;
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:59 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz