Z
zmas via AccessMonster.com
I am trying to create an "open form" command button using the wizard, but I
can't figure out why the matching field I want to choose in the left pane
isn't showing. I see the field I want in the right pane, but not on the left.
I have 3 forms that I am trying to link together somehow in a research
database. How can I get the matching fields that I need to appear to create
an 'open form' command button on form B to open form C to a selected record?
1) Medical History
2) Testing History (form B)
3) Testing History 2 (form C)
Medical History form: command button called "Enter testing data" will open
the Testing History form B to a selected record.
Command button-- opens Testing History form B using this code below, and it
works fine. The 'medical history form' and 'testing histroy form B' fields
pop up in command wizard so that I can choose 'studyid' from both and match
them.
Form-- record source='main' table, primary key= studyid in 'main' table,
control source for studyid=studyid chosen from 'main'
Private Sub Command762_Click()
On Error GoTo Err_Command762_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "STD"
stLinkCriteria = "[main.studyid]=" & Me![studyid]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command762_Click:
Exit Sub
Err_Command762_Click:
MsgBox Err.Description
Resume Exit_Command762_Click
End Sub
Testing History form B: I want to create a command button called "Enter
addtional tests" that will open the Testing History form C to a selected
record.
Form-- record source='std' query, filter=[main.studyid]=111,
control source for studyid= main.studyid textbox and there's a textbox with
control source= new.studyid ('new' is the underlying table for form B) , and
Default value is ' =[studyid] ', but this textbox for new.studyid is
invisible on the form, you only see the textbox for main.studyid in the form,
which links it back to the patient's Medical Histroy form page.
Testing History form C: This form was created because the underlying table
for form B 'new' maxed out to the number of fields that could be created. So,
I created a table to accomodate more fields/more tests called 'new2'.
Command button-- In the command wizard 'testing history form B' is on the
left, but studyid doesn't appear, 'testing history form C' appears on the
right with main.studyid and new2.studyid as choices.
Form-- record source='std2' query
control source for studyid= main.studyid textbox and there's a txtbox with
control source= new2.studyid ('new2' is the underlying table for form C) and
Default value is ' =[studyid] ', but new2studyid textbox is invisible too on
the form, you only see the textbox for main.studyid in the form, which links
it back to the patient's Medical Histroy form page.
can't figure out why the matching field I want to choose in the left pane
isn't showing. I see the field I want in the right pane, but not on the left.
I have 3 forms that I am trying to link together somehow in a research
database. How can I get the matching fields that I need to appear to create
an 'open form' command button on form B to open form C to a selected record?
1) Medical History
2) Testing History (form B)
3) Testing History 2 (form C)
Medical History form: command button called "Enter testing data" will open
the Testing History form B to a selected record.
Command button-- opens Testing History form B using this code below, and it
works fine. The 'medical history form' and 'testing histroy form B' fields
pop up in command wizard so that I can choose 'studyid' from both and match
them.
Form-- record source='main' table, primary key= studyid in 'main' table,
control source for studyid=studyid chosen from 'main'
Private Sub Command762_Click()
On Error GoTo Err_Command762_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "STD"
stLinkCriteria = "[main.studyid]=" & Me![studyid]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command762_Click:
Exit Sub
Err_Command762_Click:
MsgBox Err.Description
Resume Exit_Command762_Click
End Sub
Testing History form B: I want to create a command button called "Enter
addtional tests" that will open the Testing History form C to a selected
record.
Form-- record source='std' query, filter=[main.studyid]=111,
control source for studyid= main.studyid textbox and there's a textbox with
control source= new.studyid ('new' is the underlying table for form B) , and
Default value is ' =[studyid] ', but this textbox for new.studyid is
invisible on the form, you only see the textbox for main.studyid in the form,
which links it back to the patient's Medical Histroy form page.
Testing History form C: This form was created because the underlying table
for form B 'new' maxed out to the number of fields that could be created. So,
I created a table to accomodate more fields/more tests called 'new2'.
Command button-- In the command wizard 'testing history form B' is on the
left, but studyid doesn't appear, 'testing history form C' appears on the
right with main.studyid and new2.studyid as choices.
Form-- record source='std2' query
control source for studyid= main.studyid textbox and there's a txtbox with
control source= new2.studyid ('new2' is the underlying table for form C) and
Default value is ' =[studyid] ', but new2studyid textbox is invisible too on
the form, you only see the textbox for main.studyid in the form, which links
it back to the patient's Medical Histroy form page.