Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Software Development
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming gpu hard drive hardware hdmi internet laptop malware memory monitor motherboard netgear network printer problem ram registry router security slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
Solved: MS Access: Automatically determine the value of one field from an ID autonumb

Reply  
Thread Tools
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 14,665 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
28-Jan-2010, 11:48 AM #16
Not when there is only 4 records.
But you should be able to use the Sidebar to move around the records.
maxx_eclipse's Avatar
Computer Specs
Member with 286 posts.
 
Join Date: May 2007
Location: http://127.0.0.1
Experience: Intermediate In Few Areas
28-Jan-2010, 01:47 PM #17
Okay, I fixed the initial problem of the repositioned form, apparently the form size in design view caused the datasheet to be centred, forcing the master view to be moved up.

I'll try adapting the VBA code again and see how it goes. I'll keep you informed.
maxx_eclipse's Avatar
Computer Specs
Member with 286 posts.
 
Join Date: May 2007
Location: http://127.0.0.1
Experience: Intermediate In Few Areas
29-Jan-2010, 03:54 AM #18
OBP, I copied all the code related to the Form_Click() event for frmECS and sbfrmECS, and I changed all of the variables in my database to the respective forms, but VBA is telling me that:

Run-time error code '3159':

Not a valid bookmark, and then it highlights the following line.

Code:
Me.Parent.Bookmark = Me.Bookmark
from the sbfrmECS table

As far as I'm aware, I changed everything correctly and have gone through it a few times now.

But come to think of it, I think I know what the issue is... in the database you sent me, your split form is just a split form, with a main form and the subform (datasheet). In my case, it's a split form AS A subform... I think that Me.Parent.Bookmark has to be changed to something like Me.Subform.SUBFORM_AGENDA.Bookmark... i'll tinker around and see what I get.

I've included a screen print of the actual agenda splitform as a subform.

I'll keep you posted.
Attached Thumbnails
Solved: MS Access: Automatically determine the value of one field from an ID autonumb-problem1.jpg  

Last edited by maxx_eclipse; 29-Jan-2010 at 04:01 AM..
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 14,665 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
29-Jan-2010, 07:15 AM #19
I would make the Subform a normal Subform based on the Table or a query, avoiding the Split form all together. I don't think a split form has it's own recordset like a subform does.
maxx_eclipse's Avatar
Computer Specs
Member with 286 posts.
 
Join Date: May 2007
Location: http://127.0.0.1
Experience: Intermediate In Few Areas
29-Jan-2010, 08:22 AM #20
I'll try tinkering around with the code and let you know how it goes.
maxx_eclipse's Avatar
Computer Specs
Member with 286 posts.
 
Join Date: May 2007
Location: http://127.0.0.1
Experience: Intermediate In Few Areas
30-Jan-2010, 03:50 AM #21
OBP, I found this page, which looks useful. If I can understand what is exactly done, and which line of code I need to use, I should be able to get the dynamic update working.

http://www.mvps.org/access/forms/frm0031.htm
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 14,665 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
01-Feb-2010, 10:32 AM #22
If you set your Form & Sub Form up the same way that I have in my example the Code that provided should work for you as well.
maxx_eclipse's Avatar
Computer Specs
Member with 286 posts.
 
Join Date: May 2007
Location: http://127.0.0.1
Experience: Intermediate In Few Areas
01-Feb-2010, 11:03 AM #23
Well, if you refer to my Post #18, you'll see that I'm returned an error. However, I hypothesised why it occurs:

The code for the subform states that Me.Parent.Bookmark = Me.Bookmark

However, because the subforms operate through the main form, the subform2 uses Me.Bookmark (as it has the focus), but since subform1 is RUN THROUGH the mainform, I think I need to change the coding to:

Me![Subform1].Form.Bookmark = Me.Bookmark

I'm still yet to try this out, I'm leaving it till tomorrow to try it out and see how it goes. It's only a hypothesis, I'm only assuming that it could be the solution.
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 14,665 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
01-Feb-2010, 11:09 AM #24
I don't think that will work unless you are trying to set Subform1's bookmark to the Mainform Bookmark.
How come you have 2 Subforms?
Is Subform2 on Subform1 or the Mainform?
Which Forms are you trying to align the Bookmarks on?
Can you post an Example?
maxx_eclipse's Avatar
Computer Specs
Member with 286 posts.
 
Join Date: May 2007
Location: http://127.0.0.1
Experience: Intermediate In Few Areas
02-Feb-2010, 03:44 AM #25
Subform2 is on Subform1 which is on the Mainform

I've uploaded the database. There is one contact entry, and 2 sample agenda entries.
Attached Files
File Type: zip Database1.zip (33.9 KB, 7 views)

Last edited by maxx_eclipse; 02-Feb-2010 at 03:51 AM..
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 14,665 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
02-Feb-2010, 07:21 AM #26
OK, so I have looked at your Tabbed Mainform.
The Subform_Agenda and Subform_Agenda_Datasheet is working as it should, so what isn't working?
maxx_eclipse's Avatar
Computer Specs
Member with 286 posts.
 
Join Date: May 2007
Location: http://127.0.0.1
Experience: Intermediate In Few Areas
02-Feb-2010, 11:53 PM #27
Quote:
Originally Posted by OBP View Post
OK, so I have looked at your Tabbed Mainform.
The Subform_Agenda and Subform_Agenda_Datasheet is working as it should, so what isn't working?
But do the subforms work in the mainform? Or did you look at them seperately? Because on my end, the Subform_Agenda and Subform_Agenda_Datasheet DON'T work in the main form.

Please clarify.
maxx_eclipse's Avatar
Computer Specs
Member with 286 posts.
 
Join Date: May 2007
Location: http://127.0.0.1
Experience: Intermediate In Few Areas
03-Feb-2010, 05:24 AM #28
OBP,

I had a look at the database you did here (http://forums.techguy.org/6992705-post20.html), which is exactly the situation that I have:

Main Form
> SubForm1
>> SubForm2

And when I copied the code over to my database, I still received the same code issue in the subform2 coding, with "not a valid bookmark" problem. At first, I thought it had to with the fact that my form is pop-up. So as I changed your database, I noticed that it didn't make a difference.

HOWEVER, I've come to propose one final possibility (otherwise I've run out of ideas). I believe the code error is encountered because the "SubForm1" has a master link to the "Main Form", while the database you provided doesn't have any master link with the "Main Form"; your "SubForm1" just sits within the tabbed-form.

So to summarise, this is the difference:

Your sample database (from the post linked above) follows:

Main Form (unbound, not related to any tables)
> SubForm1
>> SubForm2


My database follows:

Main Form (BOUND by the contact information)
> SubForm1
>> SubForm2

...I'm convinced that the "Me.Parent.Bookmark" from SubForm2 conflicts with the 'Master Link' of SubForm1, and doesn't allow the code to execute. So is there anyway in trapping the error and forcing it to continue?

I am also wondering if I should ask people at the Microsoft Discussion Group to see if they could look into this and maybe see if it's a something that can be corrected as a hotfix (IF my hypothesis is to be true).

Last edited by maxx_eclipse; 03-Feb-2010 at 05:49 AM..
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 14,665 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
03-Feb-2010, 06:14 AM #29
It is working on the Mainform.
What it can't do is select the second Mainform Record in the 1st Subform as that is not possible as it is not listed due to the Master/Child Link. So the subforms can't control the Mainform Recordset.
But the 2 Subform VBA Links work exactly as expected.
Attached Files
File Type: zip Database1.zip (32.2 KB, 5 views)
__________________
OBP
I do not give up easily
maxx_eclipse's Avatar
Computer Specs
Member with 286 posts.
 
Join Date: May 2007
Location: http://127.0.0.1
Experience: Intermediate In Few Areas
03-Feb-2010, 11:39 AM #30
Hmm...for whatever reason, it's not working on my end through the mainform. Did you adjust any properties when you had a look?

Also, if I were to change the format from:

Mainform
> SubForm1
>> SubForm2

To:

MainForm
> SubForm1
> SubForm2

Would something like that work? I believe something similar was done here:

http://www.mdbmakers.com/forums/showthread.php?t=23297
Reply

Tags
access, autonumber, id number, relationship, subform

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 02:15 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.