Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open 2 instances of a form

Status
Not open for further replies.

LouiseJ

Technical User
May 18, 2005
29
GB
We have:
frmMain1 & frmMain1!frmSub1

Both forms are based on queries. frmSub1 is in continuous view with only 3 text controls (out of a possible 14) for each record. The text controls are covered by a label. I had planned for the user to double click the label and open a new form (frmMain2) based on the same query as frmSub1 to allow editing of all 14 fields.

Problem:
While frmMain1 & frmMain1!frmSub1 are open frmMain2 is locked for editing. I incorrectly assumed that if frmMain1!frmSub1 was set to Snap Shot and frmMain2 to Dynaset it would work, but it doesn’t! Is there away around this or has frmMain1 & frmMain1!frmSub1 got to be closed first before opening frmMain2 and then reopened when frmMain2 is closed to show the newly edited data.

Thanks

LouiseJ
 
How are ya LouiseJ . . .

Are you [blue]synchronizing[/blue] frmMain2 with frmMain1!frmSub1?
LouiseJ said:
[blue]I incorrectly assumed that if frmMain1!frmSub1 was set to Snap Shot and frmMain2 to Dynaset [purple]it would work[/purple], but it doesn’t![/blue]
What would work?

If your putting labels on top of the textboxes of frmSub1, whats the point of frmSub1?

When you say . . .
LouiseJ said:
[blue]While frmMain1 & frmMain1!frmSub1 are open . . .[/blue]
Are you saying you have two instances of frmMain1 open or just the one?

At this point I'm just trying to pull out needed info from the vagueness of your post origination . . . [blue]Please answer all questions![/blue]

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Hi TheAceMan1

Happy New Year to you.

Thanks for coming back.

Please bear with me and I’ll try to explain a little better.

frmMain1 shows customer records.

frmMain1!frmSub1 shows designs for each customer record (one to many). This sub form is in continuous view, each record occupies one line of the sub form and only has 3 text boxes, txtDesignNumber, txtDesignDescription and txtDesignSize. A label covers the textboxes to prevent user from entering them.

On the double click event of the label covering the 3 text boxes, frmMain2 opens and displays the same record that was current in frmMain1frmSub1 with the Design Number, Design Description, Design Size and a further 11 textboxes (14 in all).

What ‘will not work’ is that the design info can not be edited in frmMain2 while frmMain1!frmSub1 is open. I incorrectly assumed that by setting frmMain1!frmSub1 to snapshot and frmMain2 to dynaset that it would.

The reason for opening frmMain2 to show / allow editing of all the information in the design record is that it is not possible to fit all 14 textboxes on one line in frmMain1frmSub1.

I hope this is a little easier to follow.

Thank you.

LouiseJ
 
Happy New year Back LouiseJ . . .

Your latest post was simply a little more exploded explanation of your post origination! Since you opted to explain a little more instead of answering my questions, Id like to make a point here . . . espcially after going over your profile! . . . and understand! . . . I'm not trying to be or sound demeaning in any way! . . .

The biggest mistake those who come here for help make (professional or otherwise) is not answering questions put to them by those they seek the help from! . . . and they would profess to be in contact with the experts they know could/would help them! . . .

Calvin.gif
See Ya! . . . . . .
 
LouiseJ . . . I hit submitt too soon! . . .

Since you didn't answer one of my questions the following is the best I can come up with ubder the circumstances.

[ol][li]Your [blue]frmSub1[/blue] is superfluous and apparently not needed!. Better to have a button that opens [blue]frmMain2[/blue] instead![/li]
[li]There's no law that saids a record is tied to one row! A record can comprise as many rows as you deem necessary! . . . to fit on the screen!. As an example of this use the [blue]form wizard[/blue] to generate [blue]frmMain2[/blue] only select justified and fit all fields (with label) into view. This is what it would look like![/li]
[li]I don't know yet but its possible the recordsource of [blue]frmMain2[/blue] is uneditable! . . . which means [blue]frmSub1[/blue] is uneditable as well!. In order to tell if the returned [blue]Recordset[/blue] of a [blue]form[/blue] (Allow Additions property set to [purple]Yes[/purple]) or [blue]query[/blue] is [blue]updateable[/blue] have a look at the AddNew button
AddNewEnabled.BMP
, if it has that disabled look
AddNewDisabled.BMP
then the recordset is uneditable![/li][/ol]
[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Thanks for the 3 options.


1. frmSub1 was designed this way to allow the user a ‘quick glance’ at the records to locate the one they wanted before opening frmMain2 to see all of the detail of the record. (frmMain2 also has a sub form in it – did not mention this previously apologies if relevant.)

2. Agreed there is no law. The sub form was designed this way for ease of use for the user and is also much more aesthetically pleasing to the eye.

3. Here I think lies the problem. Both forms are using the same record set returned by the same query. If only frmSub1 is open the records can be edited. If only Mainfrm2 is open the records can be edited. However while frmSub1 is open and frmMain2 then opened, records can not be edited from frmMain2.


Thanks for your patience. Your input really is appreciated.

LouiseJ
 
LouiseJ . . .

Paramout before I go any further . . . when you have [blue]frmMain1!frmSub1[/blue] open . . . does the Addnew button of [blue]frmsub1[/blue]
AddNewEnabled.BMP
have that disabled look
AddNewDisabled.BMP
or not?

Calvin.gif
See Ya! . . . . . .
 
Yes it does have the disabled look!
(Sorry, overlooked this as form originally designed with out navigation buttons)

LouiseJ
 
LouiseJ . . .

Then the [blue]RecordSource[/blue] of [blue]frmSub1[/blue] & [blue]frmMain2[/blue] (most likely a query or SQL) is returning an [purple]uneditable recordset![/purple]

Have a look here for resolution: Harnessing the Power of Updatable Queries

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Thank you for your perseverance TheAceMan1 and for pointing me in the right direction.

I had made a really obvious mistake with the Link Master field in the sub forms recordset. All is now working fine.

Thanks again.

LouiseJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top