Opening a form from within another form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In an effort to keep my data entry form uncrowded I woul like to be able to
prompt for additional information when certain boxes are checked. I have been
able to get everything to work except for 1 thing. When a user checks a box
that indicates that a thank you note has been sent to a customer, he is
prompted (by a new form) to enter the date that the note was sent. The
problem is that the response on the date form is stored in a different record
than all of the rest of the information. ie(name, address, status, whether or
not a thank you not has been sent) are all in record number 1, And the date
that the thank you note was sent is the only field with information in it in
record number 2

Thanks for your help.
 
Firstly a question, do you mean by "records number", table?

In the on click event of the check box the user selects for a thank you note
sent, You would need to enter some code similar ot the following.

If Me.Checkbox = -1 then
Docmd.openform "ThankYouNoteSentDateForm",,,,acAdd
Else
End If

This will open a form ThankyouNote etc (you can make this whenever) in add
mode when the check box (ive assumed is called check box) is ticked.

HTH

Rico
 
Yes, I am trying to add records to a table. I don't have any problem gettin
the form to open, and the data entered is saved to the correct table, the
problem is that the date entered is saved into a different record in the
table.

ie

cust # name address city thankyousent date
1 frank 111 main NY Y
2 1/1/2005
 
O right sorry.

This is because the form starts a new record when you open the form. The way
you have it at the moment will not work. You need to set up another table for
the date and link it to the first table using customer number. New table:

ThankYouDateID CUstNo Date (I Would also add)
Name

There is another solution which might be easier:

The form that opens up, set the form and the date field to unbound. And on
your main form have a field bound the Thankyoudate field with its visble
property off.
Then in the onclick of a button on the pop up form:

Forms!Mainform![ThankyouNoteDate]=Forms!ThankYounoteFrm![FieldName]
Docmd.close acForm, "FormName"

HTH
 
Awsome!! thank you for taking the time to help out
Andy


rico said:
O right sorry.

This is because the form starts a new record when you open the form. The way
you have it at the moment will not work. You need to set up another table for
the date and link it to the first table using customer number. New table:

ThankYouDateID CUstNo Date (I Would also add)
Name

There is another solution which might be easier:

The form that opens up, set the form and the date field to unbound. And on
your main form have a field bound the Thankyoudate field with its visble
property off.
Then in the onclick of a button on the pop up form:

Forms!Mainform![ThankyouNoteDate]=Forms!ThankYounoteFrm![FieldName]
Docmd.close acForm, "FormName"

HTH

Andy Taylor said:
Yes, I am trying to add records to a table. I don't have any problem gettin
the form to open, and the data entered is saved to the correct table, the
problem is that the date entered is saved into a different record in the
table.

ie

cust # name address city thankyousent date
1 frank 111 main NY Y
2 1/1/2005
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top