Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1. Guest ji, please consider donating today!
      Become a Supporter    ::   Make a Contribution   
    Monthly Recurring Target: $300 :: Achieved: $95

Help

Discussion in 'Information Technology' started by Tom, Jul 28, 2006.

Tags:
  1. Tom

    Tom
    Expand Collapse
    Guest

    Hi all,

    2 questions here:

    Can I control visibility of a form from a different form? If yes - how?
    I have form1 and form2. Form1 is invisible, On form2 I have a button, when I
    click it I need form1 to show.


    I need to delete all the records which are 60 days old from tblOrders . the
    field is OrderDate.
    what is the right syntax of the sql statment?


    Thanks for the help,
    Tom
     
  2. Loading...


  3. kabaka

    kabaka
    Expand Collapse
    Guest

    #1) I am assuming form1 is open: in the OnClick event of you button on form2
    Sub btn1_OnClick()
    dim boo as boolean
    boo = forms!("Form1").visible
    Forms!("Form1").visible = not boo
    End Sub


    #2) Did you mean equals 60 days or greater than 60 days? Just change the
    ">" to "=" if necessary:

    DELETE [tblOrders].*FROM [tblOrders] WHERE
    (((DateDiff("d",[OrderDate],Date()))>60));


    "Tom" wrote:

    > Hi all,
    >
    > 2 questions here:
    >
    > Can I control visibility of a form from a different form? If yes - how?
    > I have form1 and form2. Form1 is invisible, On form2 I have a button, when I
    > click it I need form1 to show.
    >
    >
    > I need to delete all the records which are 60 days old from tblOrders . the
    > field is OrderDate.
    > what is the right syntax of the sql statment?
    >
    >
    > Thanks for the help,
    > Tom
    >
    >
    >
     
  4. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On Mon, 19 Jun 2006 13:08:14 -0400, "Tom" <partner1973@yahoo.com>
    wrote:

    >Hi all,
    >
    >2 questions here:
    >
    >Can I control visibility of a form from a different form? If yes - how?
    >I have form1 and form2. Form1 is invisible, On form2 I have a button, when I
    >click it I need form1 to show.


    Sure: you'll need to use the OpenForm method to bring the form "to the
    front" as well:

    Private Sub cmdShowForm2_Click()
    DoCmd.OpenForm "Form2", <optional arguments>
    Forms!Form2.Visible = True
    End Sub

    >
    >I need to delete all the records which are 60 days old from tblOrders . the
    >field is OrderDate.
    >what is the right syntax of the sql statment?


    Well... think about this. What if a customer calls up and says "I
    bought a widget three months ago, and I was overcharged." What about
    year-end summaries? What about taxes? Is your database in fact
    approaching 2 billion bytes, or is performance irretrievably
    declining?

    If you still DO want to permanently, irrevokably delete records, the
    SQL is

    DELETE * FROM tblOrders WHERE OrderDate < DateAdd("d", -60, Date())

    John W. Vinson[MVP]
     
  5. Tom

    Tom
    Expand Collapse
    Guest

    Thank you for your time, help and input.
    Tom
    "John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
    news:rbud925t8hed9vbpc25s3jdc5id54loljv@4ax.com...
    > On Mon, 19 Jun 2006 13:08:14 -0400, "Tom" <partner1973@yahoo.com>
    > wrote:
    >
    >>Hi all,
    >>
    >>2 questions here:
    >>
    >>Can I control visibility of a form from a different form? If yes - how?
    >>I have form1 and form2. Form1 is invisible, On form2 I have a button, when
    >>I
    >>click it I need form1 to show.

    >
    > Sure: you'll need to use the OpenForm method to bring the form "to the
    > front" as well:
    >
    > Private Sub cmdShowForm2_Click()
    > DoCmd.OpenForm "Form2", <optional arguments>
    > Forms!Form2.Visible = True
    > End Sub
    >
    >>
    >>I need to delete all the records which are 60 days old from tblOrders .
    >>the
    >>field is OrderDate.
    >>what is the right syntax of the sql statment?

    >
    > Well... think about this. What if a customer calls up and says "I
    > bought a widget three months ago, and I was overcharged." What about
    > year-end summaries? What about taxes? Is your database in fact
    > approaching 2 billion bytes, or is performance irretrievably
    > declining?
    >
    > If you still DO want to permanently, irrevokably delete records, the
    > SQL is
    >
    > DELETE * FROM tblOrders WHERE OrderDate < DateAdd("d", -60, Date())
    >
    > John W. Vinson[MVP]
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page