Need help with frm/subfrm TY

T

TotallyConfused

ave a main from and subform (frm 1). My main form holds docs names, my
subform (frm2) lists pts with doc on my form. From within my subform I call
another form (frm3) to be able to add dates for specific pt. In my “frm3â€,
I have ID, doc ID and pt ID and fields for 3 dates: Send Date, Due Date,
Response Date. I would like for my “frm3†to be able to add another row of
Dates for that specific pt ID. What my form is doing now is when I click on
the “new date button†it will move to “Record 2†and the Date fields are
blank which good for the Date fields to be blank but the ID, doc ID and pt ID
are blank also. I want to maintain the ID, DOC ID and PT id when adding new
date fields for the specific record. I also would like the dates to be added
right below the first set of dates. Can this be done and so how. Can
someome please help me with this as this is driving me crazy. Thank you very
much in advance for any help you can provide. Attached is my code for the
command button “frm2†that calls “frm 3â€.

Private Sub cmdtrkdts_Click()
On Error GoTo Err_cmdtrkdts_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "PTTRKDTs"

stLinkCriteria = "[DOCID]=" & Me![DOCID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdtrkgfxs_Click:
Exit Sub

Err_cmdtrkdts_Click:
MsgBox Err.Description
Resume Exit_cmdtrkgfxs_Click
 
J

Jeanette Cunningham

Hi TotallyConfused,
You can set the default values for ID, DOC ID and PT id on frm3.
Pass the values to use in open args when you open frm3.
Use the open args to set the default values for ID, DOC ID and PT id on
frm3.

Sounds like it could be an issue where you need a main form and subform set
up for frm3.
I mean that the appropriate main form for frm3 is missing.
Create frm3 as a subform of the appropriate main form, then open that form
instead of frm3.



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
T

TotallyConfused

Thank you for responding. I am sorry but could you give me an example of
"Pass the values to use in open args when you open frm3. Use the open args
to set the default values for ID, DOC ID and Pt ID on frm3.

Thank you.

Jeanette Cunningham said:
Hi TotallyConfused,
You can set the default values for ID, DOC ID and PT id on frm3.
Pass the values to use in open args when you open frm3.
Use the open args to set the default values for ID, DOC ID and PT id on
frm3.

Sounds like it could be an issue where you need a main form and subform set
up for frm3.
I mean that the appropriate main form for frm3 is missing.
Create frm3 as a subform of the appropriate main form, then open that form
instead of frm3.



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


TotallyConfused said:
ave a main from and subform (frm 1). My main form holds docs names, my
subform (frm2) lists pts with doc on my form. From within my subform I
call
another form (frm3) to be able to add dates for specific pt. In my
"frm3",
I have ID, doc ID and pt ID and fields for 3 dates: Send Date, Due Date,
Response Date. I would like for my "frm3" to be able to add another row
of
Dates for that specific pt ID. What my form is doing now is when I click
on
the "new date button" it will move to "Record 2" and the Date fields are
blank which good for the Date fields to be blank but the ID, doc ID and pt
ID
are blank also. I want to maintain the ID, DOC ID and PT id when adding
new
date fields for the specific record. I also would like the dates to be
added
right below the first set of dates. Can this be done and so how. Can
someome please help me with this as this is driving me crazy. Thank you
very
much in advance for any help you can provide. Attached is my code for the
command button "frm2" that calls "frm 3".

Private Sub cmdtrkdts_Click()
On Error GoTo Err_cmdtrkdts_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "PTTRKDTs"

stLinkCriteria = "[DOCID]=" & Me![DOCID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdtrkgfxs_Click:
Exit Sub

Err_cmdtrkdts_Click:
MsgBox Err.Description
Resume Exit_cmdtrkgfxs_Click
 
T

TotallyConfused

I clicked to fast. I please excuse my ignorance but, if I make frm 3 a
subform of the main form will frm3/subform be visible always? I only need to
make frm/subform accessible when entering dates? thank you.

Jeanette Cunningham said:
Hi TotallyConfused,
You can set the default values for ID, DOC ID and PT id on frm3.
Pass the values to use in open args when you open frm3.
Use the open args to set the default values for ID, DOC ID and PT id on
frm3.

Sounds like it could be an issue where you need a main form and subform set
up for frm3.
I mean that the appropriate main form for frm3 is missing.
Create frm3 as a subform of the appropriate main form, then open that form
instead of frm3.



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


TotallyConfused said:
ave a main from and subform (frm 1). My main form holds docs names, my
subform (frm2) lists pts with doc on my form. From within my subform I
call
another form (frm3) to be able to add dates for specific pt. In my
"frm3",
I have ID, doc ID and pt ID and fields for 3 dates: Send Date, Due Date,
Response Date. I would like for my "frm3" to be able to add another row
of
Dates for that specific pt ID. What my form is doing now is when I click
on
the "new date button" it will move to "Record 2" and the Date fields are
blank which good for the Date fields to be blank but the ID, doc ID and pt
ID
are blank also. I want to maintain the ID, DOC ID and PT id when adding
new
date fields for the specific record. I also would like the dates to be
added
right below the first set of dates. Can this be done and so how. Can
someome please help me with this as this is driving me crazy. Thank you
very
much in advance for any help you can provide. Attached is my code for the
command button "frm2" that calls "frm 3".

Private Sub cmdtrkdts_Click()
On Error GoTo Err_cmdtrkdts_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "PTTRKDTs"

stLinkCriteria = "[DOCID]=" & Me![DOCID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdtrkgfxs_Click:
Exit Sub

Err_cmdtrkdts_Click:
MsgBox Err.Description
Resume Exit_cmdtrkgfxs_Click
 
J

Jeanette Cunningham

It will be visible all the time unless you use code to hide and show it.
Me.sfrm3.Visible = True will show it
Me.sfrm3.Visible = False will hide it.

Sounds like a simple solution.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



TotallyConfused said:
I clicked to fast. I please excuse my ignorance but, if I make frm 3 a
subform of the main form will frm3/subform be visible always? I only need
to
make frm/subform accessible when entering dates? thank you.

Jeanette Cunningham said:
Hi TotallyConfused,
You can set the default values for ID, DOC ID and PT id on frm3.
Pass the values to use in open args when you open frm3.
Use the open args to set the default values for ID, DOC ID and PT id on
frm3.

Sounds like it could be an issue where you need a main form and subform
set
up for frm3.
I mean that the appropriate main form for frm3 is missing.
Create frm3 as a subform of the appropriate main form, then open that
form
instead of frm3.



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


TotallyConfused said:
ave a main from and subform (frm 1). My main form holds docs names, my
subform (frm2) lists pts with doc on my form. From within my subform I
call
another form (frm3) to be able to add dates for specific pt. In my
"frm3",
I have ID, doc ID and pt ID and fields for 3 dates: Send Date, Due
Date,
Response Date. I would like for my "frm3" to be able to add another
row
of
Dates for that specific pt ID. What my form is doing now is when I
click
on
the "new date button" it will move to "Record 2" and the Date fields
are
blank which good for the Date fields to be blank but the ID, doc ID and
pt
ID
are blank also. I want to maintain the ID, DOC ID and PT id when
adding
new
date fields for the specific record. I also would like the dates to be
added
right below the first set of dates. Can this be done and so how. Can
someome please help me with this as this is driving me crazy. Thank
you
very
much in advance for any help you can provide. Attached is my code for
the
command button "frm2" that calls "frm 3".

Private Sub cmdtrkdts_Click()
On Error GoTo Err_cmdtrkdts_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "PTTRKDTs"

stLinkCriteria = "[DOCID]=" & Me![DOCID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdtrkgfxs_Click:
Exit Sub

Err_cmdtrkdts_Click:
MsgBox Err.Description
Resume Exit_cmdtrkgfxs_Click
 

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

Top