472,988 Members | 2,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,988 software developers and data experts.

Quick help w/ Properties

Hello,

Can someone help me quickly w/ properties.

I have 2 forms (say Form1 and Form2). When a user enters a value on Form1
I want to make it available to Form2. I declared a public property on
Form2 and on Form1 set the property (declared on Form2) to the value then
tried to use it on Form2. This isn't working...see code below.

Form2....
private DateTime startDateTime;

public DateTime StartDateTime
{
get
{
return startDateTime;
}
set
{
startDateTime = value;
}
}

Form1...
private DateTime Time;
Form2.StartDateTime = Time;
But this does not work, I don't get the value that I entered. If I declare
and set the property in Form1, it works perfectly. What am I doing wrong?
Thanks in advance....

Doug

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 15 '05 #1
1 1266
Hi Doug,

That shoudl works fine if Form2 is ShowDialog'ed
Are you sure that you are assigning the value entered to the form2
property?

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Doug" <dk*******@hotmail.com> wrote in message
news:op**************@msnews.microsoft.com...
Hello,

Can someone help me quickly w/ properties.

I have 2 forms (say Form1 and Form2). When a user enters a value on Form1
I want to make it available to Form2. I declared a public property on
Form2 and on Form1 set the property (declared on Form2) to the value then
tried to use it on Form2. This isn't working...see code below.

Form2....
private DateTime startDateTime;

public DateTime StartDateTime
{
get
{
return startDateTime;
}
set
{
startDateTime = value;
}
}

Form1...
private DateTime Time;
Form2.StartDateTime = Time;
But this does not work, I don't get the value that I entered. If I declare and set the property in Form1, it works perfectly. What am I doing wrong?
Thanks in advance....

Doug

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.