BrowseTo opens form as NewRecord depending on opened record

razovsuki

Registered User.
Local time
Today, 23:04
Joined
Feb 17, 2015
Messages
17
Hi everyone,

I need your enlightening suggestions again!
I can't quite figure out the cause of the issue I'm having, and the result that I get doesn't quite make sense to me.
So, here goes:

I'm using a navigation control to switch between forms. In one of those forms, I have a continuous subform which is a list of Projects (source is a query) that is read-only. To edit a project, I can click on its name, which switches the form displayed in the navigation control via docmd.BrowseTo (with acEditForm as the last parameter). This works fine. The proper form opens, with the proper project being displayed.

Now, on this second form, I have on the right the list of tasks contained in the project in a continuous subform (source is a query), and on the left another subform which is kind of an "edit bar" that I use to actually edit the individual tasks. So, when I click on a task in the task list, the OnCurrent event triggers a docmd.BrowseTo command that updates the "edit bar" subform and passes the ID of the task as the WhereCondition parameter. This updates the values displayed in the Edit Bar to that of the selected task, which I can then edit.

Now here's the thing: depending on the project I open, the Edit Bar doesn't work. Actually, it looks like only one of the projects is working, while the others are not (and I managed to have a different project working, but only one works at any given try). When it doesn't work, the Edit Bar is in "NewRecord = True" for some reason. All the other properties of that subform seem to be the same between when it works and when it doesn't.
So, it looks like the same command (docmd.BrowseTo with acEditForm) opens the subform properly in acEditMode when it works, and in something else when it doesn't, depending on the parent record that's being opened.
This really gets me, I really can't figure out how that's even possible.
I suspect it might have something to do with locked records, maybe?

Do you have any idea what's happening here?

Many thanks in advance for your kind help!
 
I think you are expecting too much from our powers of imagination.

Strip your db to bare essentials to illustrate the problem, attach it here and supply instructions how to reproduce the problem.

Do mention which version you are using - not all of us have all versions.
 
Haha, fair enough.
I'll see if I can get that done today.
Thanks!
 

Users who are viewing this thread

Back
Top Bottom