dbTalk Databases Forums  

subform not opening requested form/s

comp.databases.ms-access comp.databases.ms-access


Discuss subform not opening requested form/s in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Stinky Pete
 
Posts: n/a

Default subform not opening requested form/s - 11-10-2010 , 02:46 AM






Hi,

I'm totally flummoxed. We've had to change our change control
practices and I've been happily coding along until today. Goal is
that we need to still work on and close old/open change requests while
at the same time logging and actioning new ones. So, I've now got
four forms - crf_log_list_frm (+ a subform), crf_log_frm and
crf_log_new_frm, working off one table crf_log_tbl. The table has had
an additional field new_old so that a "1" is an old change type and a
"2" is a new type. Why, the data's basically 90% the same, but we've
added an addtional approval step to the process and it made no sense
to make two tables. Don't want to either. There's a lot of data for
KPI stuff and it'd be silly to have to work off two tables.

_Goal_:

open the crf_log_lst_frm and double click on a record in the
crf_log_list_subform so when looking in the table, the correct form
opens.

_Problem (as of today)_:

double clicking on anything that is a "1" works like a treat, opening
the right form, with the right record, every time.
dobule clicking on anything that is a "2" ALWAYS opens on one
particular record which is a "2". Currently the only way to open
another "2" record is to run the subform by itself and the re double
click on the record. Did NOT have to do this yesterday and I've
changed the "2"s manually to see if it's made any difference -
didn't. The code below makes no difference if the crf_log_list form
is closed first or last and was not going stupid yesterday.

_Code (which was working quite well)_:

Private Sub Form_DblClick(Cancel As Integer)

Dim stLinkCriteria As String

stLinkCriteria = "[CRF_ID]=" & "" & Me![CRF_ID] & ""

If [New_old] = "1" Then

DoCmd.OpenForm "CRF_log_frm", , , stLinkCriteria
DoCmd.Close acForm, "crf_log_list_frm"
DoCmd.Maximize

End If

If [New_old] = "2" Then

DoCmd.OpenForm "CRF_log_new_frm", , , stLinkCriteria
DoCmd.Close acForm, "crf_log_list_frm"
DoCmd.Maximize

End If

End Sub

_Difference_:

today I added some extra records in the table with the view to
automatically adding extra records from differing States,
diffentiating the change request number with a prefix "B" or "S", but
the CRF ID number is always unique. All other data is the same and
it's not making any difference if I remove the new "S" data and stick
with the "B"s that have always been in the table.

Regards,

Stinky Pete ;-)

Reply With Quote
  #2  
Old   
Roger
 
Posts: n/a

Default Re: subform not opening requested form/s - 11-10-2010 , 05:01 AM






On Nov 10, 1:46*am, Stinky Pete <captainm... (AT) hotmail (DOT) com> wrote:
Quote:
Hi,

I'm totally flummoxed. *We've had to change our change control
practices and I've been happily coding along until today. *Goal is
that we need to still work on and close old/open change requests while
at the same time logging and actioning new ones. *So, I've now got
four forms - crf_log_list_frm (+ a subform), crf_log_frm and
crf_log_new_frm, working off one table crf_log_tbl. *The table has had
an additional field new_old so that a "1" is an old change type and a
"2" is a new type. *Why, the data's basically 90% the same, but we've
added an addtional approval step to the process and it made no sense
to make two tables. Don't want to either. *There's a lot of data for
KPI stuff and it'd be silly to have to work off two tables.

_Goal_:

open the crf_log_lst_frm and double click on a record in the
crf_log_list_subform so when looking in the table, the correct form
opens.

_Problem (as of today)_:

double clicking on anything that is a "1" works like a treat, opening
the right form, with the right record, every time.
dobule clicking on anything that is a "2" ALWAYS opens on one
particular record which is a "2". *Currently the only way to open
another "2" record is to run the subform by itself and the re double
click on the record. *Did NOT have to do this yesterday and I've
changed the "2"s manually to see if it's made any difference -
didn't. *The code below makes no difference if the crf_log_list form
is closed first or last and was not going stupid yesterday.

_Code (which was working quite well)_:

Private Sub Form_DblClick(Cancel As Integer)

Dim stLinkCriteria As String

* * stLinkCriteria = "[CRF_ID]=" & "" & Me![CRF_ID] & ""

* * If [New_old] = "1" Then

* * DoCmd.OpenForm "CRF_log_frm", , , stLinkCriteria
* * DoCmd.Close acForm, "crf_log_list_frm"
* * DoCmd.Maximize

* * End If

* * If [New_old] = "2" Then

* * DoCmd.OpenForm "CRF_log_new_frm", , , stLinkCriteria
* * DoCmd.Close acForm, "crf_log_list_frm"
* * DoCmd.Maximize

* * End If

End Sub

_Difference_:

today I added some extra records in the table with the view to
automatically adding extra records from differing States,
diffentiating the change request number with a prefix "B" or "S", but
the CRF ID number is always unique. *All other data is the same and
it's not making any difference if I remove the new "S" data and stick
with the "B"s that have always been in the table.

Regards,

Stinky Pete ;-)
is the recordsource for form CRF_log_new_frm selecting just one
record, ie. for testing purposes ?
this would cause the 'where' clause in openForm to seem like it is
selecting the wrong record

Reply With Quote
  #3  
Old   
Stinky Pete
 
Posts: n/a

Default Re: subform not opening requested form/s - 11-10-2010 , 03:10 PM



On Nov 10, 9:01*pm, Roger <lesperan... (AT) natpro (DOT) com> wrote:
Quote:
On Nov 10, 1:46*am, Stinky Pete <captainm... (AT) hotmail (DOT) com> wrote:



Hi,

I'm totally flummoxed. *We've had to change our change control
practices and I've been happily coding along until today. *Goal is
that we need to still work on and close old/open change requests while
at the same time logging and actioning new ones. *So, I've now got
four forms - crf_log_list_frm (+ a subform), crf_log_frm and
crf_log_new_frm, working off one table crf_log_tbl. *The table has had
an additional field new_old so that a "1" is an old change type and a
"2" is a new type. *Why, the data's basically 90% the same, but we've
added an addtional approval step to the process and it made no sense
to make two tables. Don't want to either. *There's a lot of data for
KPI stuff and it'd be silly to have to work off two tables.

_Goal_:

open the crf_log_lst_frm and double click on a record in the
crf_log_list_subform so when looking in the table, the correct form
opens.

_Problem (as of today)_:

double clicking on anything that is a "1" works like a treat, opening
the right form, with the right record, every time.
dobule clicking on anything that is a "2" ALWAYS opens on one
particular record which is a "2". *Currently the only way to open
another "2" record is to run the subform by itself and the re double
click on the record. *Did NOT have to do this yesterday and I've
changed the "2"s manually to see if it's made any difference -
didn't. *The code below makes no difference if the crf_log_list form
is closed first or last and was not going stupid yesterday.

_Code (which was working quite well)_:

Private Sub Form_DblClick(Cancel As Integer)

Dim stLinkCriteria As String

* * stLinkCriteria = "[CRF_ID]=" & "" & Me![CRF_ID] & ""

* * If [New_old] = "1" Then

* * DoCmd.OpenForm "CRF_log_frm", , , stLinkCriteria
* * DoCmd.Close acForm, "crf_log_list_frm"
* * DoCmd.Maximize

* * End If

* * If [New_old] = "2" Then

* * DoCmd.OpenForm "CRF_log_new_frm", , , stLinkCriteria
* * DoCmd.Close acForm, "crf_log_list_frm"
* * DoCmd.Maximize

* * End If

End Sub

_Difference_:

today I added some extra records in the table with the view to
automatically adding extra records from differing States,
diffentiating the change request number with a prefix "B" or "S", but
the CRF ID number is always unique. *All other data is the same and
it's not making any difference if I remove the new "S" data and stick
with the "B"s that have always been in the table.

Regards,

Stinky Pete ;-)

is the recordsource for form CRF_log_new_frm selecting just one
record, ie. for testing purposes ?
this would cause the 'where' clause in openForm to seem like it is
selecting the wrong record
The CRF_log_list_frm has the list of all change requests and by dbl
clicking on the identified record, the above listed code grabs the CRF
ID and populates the new or old change request form. The subform has
the same set of paramaters for both the new and old change request
forms.

Reply With Quote
  #4  
Old   
Stinky Pete
 
Posts: n/a

Default Re: subform not opening requested form/s - 11-10-2010 , 06:42 PM



On Nov 10, 9:01*pm, Roger <lesperan... (AT) natpro (DOT) com> wrote:
Quote:
On Nov 10, 1:46*am, Stinky Pete <captainm... (AT) hotmail (DOT) com> wrote:





Hi,

I'm totally flummoxed. *We've had to change our change control
practices and I've been happily coding along until today. *Goal is
that we need to still work on and close old/open change requests while
at the same time logging and actioning new ones. *So, I've now got
four forms - crf_log_list_frm (+ a subform), crf_log_frm and
crf_log_new_frm, working off one table crf_log_tbl. *The table has had
an additional field new_old so that a "1" is an old change type and a
"2" is a new type. *Why, the data's basically 90% the same, but we've
added an addtional approval step to the process and it made no sense
to make two tables. Don't want to either. *There's a lot of data for
KPI stuff and it'd be silly to have to work off two tables.

_Goal_:

open the crf_log_lst_frm and double click on a record in the
crf_log_list_subform so when looking in the table, the correct form
opens.

_Problem (as of today)_:

double clicking on anything that is a "1" works like a treat, opening
the right form, with the right record, every time.
dobule clicking on anything that is a "2" ALWAYS opens on one
particular record which is a "2". *Currently the only way to open
another "2" record is to run the subform by itself and the re double
click on the record. *Did NOT have to do this yesterday and I've
changed the "2"s manually to see if it's made any difference -
didn't. *The code below makes no difference if the crf_log_list form
is closed first or last and was not going stupid yesterday.

_Code (which was working quite well)_:

Private Sub Form_DblClick(Cancel As Integer)

Dim stLinkCriteria As String

* * stLinkCriteria = "[CRF_ID]=" & "" & Me![CRF_ID] & ""

* * If [New_old] = "1" Then

* * DoCmd.OpenForm "CRF_log_frm", , , stLinkCriteria
* * DoCmd.Close acForm, "crf_log_list_frm"
* * DoCmd.Maximize

* * End If

* * If [New_old] = "2" Then

* * DoCmd.OpenForm "CRF_log_new_frm", , , stLinkCriteria
* * DoCmd.Close acForm, "crf_log_list_frm"
* * DoCmd.Maximize

* * End If

End Sub

_Difference_:

today I added some extra records in the table with the view to
automatically adding extra records from differing States,
diffentiating the change request number with a prefix "B" or "S", but
the CRF ID number is always unique. *All other data is the same and
it's not making any difference if I remove the new "S" data and stick
with the "B"s that have always been in the table.

Regards,

Stinky Pete ;-)

is the recordsource for form CRF_log_new_frm selecting just one
record, ie. for testing purposes ?
this would cause the 'where' clause in openForm to seem like it is
selecting the wrong record- Hide quoted text -

- Show quoted text -
I had a rethink when I got into work and changed the setup so that
both the new and old change requests forms open up when the crf list
form/subform opens. Now seems to work, but as to why it was working
without this requirement and then not, still totally stumps me.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.