Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Open subform that has the current record of calling form at opening

18 May 2013   #1
Silvera

Windows 7 Home Premium 64bit
 
 
Open subform that has the current record of calling form at opening

I though this would be simple but searches have not worked. here is my code from the caling form:

Private Sub BD_stuff_Click()
On Error GoTo Err_BD_stuff_Click
Dim stDocName As String
Dim stLinkCriteria As String
stLinkCriteria = CurrentRecord
stDocName = "RFIsBD_stuff"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_BD_stuff_Click:
Exit Sub
Err_BD_stuff_Click:
MsgBox Err.Description
Resume Exit_BD_stuff_Click
End Sub

I thought defining the "stLinkCriteria" would work but it did not. I've tried severa other things from on line searches but nothing has worked the subform always is opened to the 1st record.


My System SpecsSystem Spec
.

22 May 2013   #2
pcunite

Windows 7 x64
 
 

I don't understand the context for this question. Searching this forum, from your hard drive, from an application?
My System SpecsSystem Spec
22 May 2013   #3
Kaktussoft

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

Quote   Quote: Originally Posted by Silvera View Post
I though this would be simple but searches have not worked. here is my code from the caling form:

Private Sub BD_stuff_Click()
On Error GoTo Err_BD_stuff_Click
Dim stDocName As String
Dim stLinkCriteria As String
stLinkCriteria = CurrentRecord
stDocName = "RFIsBD_stuff"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_BD_stuff_Click:
Exit Sub
Err_BD_stuff_Click:
MsgBox Err.Description
Resume Exit_BD_stuff_Click
End Sub

I thought defining the "stLinkCriteria" would work but it did not. I've tried severa other things from on line searches but nothing has worked the subform always is opened to the 1st record.
This is all about ms access isn't it? Line "Resume Exit_BD_stuff_Click" can be removed....totally useless.
It's not a subform at all! It's just a new form you open from a routine (most liekly a button click). The problem is stLinkCriteria. What do you want to accomplish with: stLinkCriteria = CurrentRecord?
CurrentRecord is a property of the form so should be programmed as Me.CurrentRecord. But what do you want to do with current record number?
My System SpecsSystem Spec
.


22 May 2013   #4
Kaktussoft

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

My System SpecsSystem Spec
22 May 2013   #5
Silvera

Windows 7 Home Premium 64bit
 
 

You are correct. I posted it on an access forum but did not get a response. Glad you knew what I was talking about. I have since realized that is was not a sub form but a supplemental [yes separate] form, I added new fields to track a new situation so I created this form to manipulate the new data. A friend also a part-time programer for his job we are both architects. He manages the firm and I the construction administration of project being built. He suggested I define stLinkCriteria, I probable misunderstood what he was telling.

Yes I use a label as a button to call the new form. I want it to open at the same record as the one that is calling the new one. I've been self teaching myself data base programing since the mid 80' and do not do it enough to remember all I have learned. I will try it out later this afternoon to see if I can make it work. Thank you very much for responding to me cry for help!!!
My System SpecsSystem Spec
22 May 2013   #6
Kaktussoft

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

What do you mean by saying "same record"? Has the record a primary key? Is recordsource on called form the same as calling form?
My System SpecsSystem Spec
Reply

 Open subform that has the current record of calling form at opening




Thread Tools





Similar help and support threads
Thread Forum
add a record file(WAV) in the current directory in win7
In windows 7, when I want to add a WAV file in the current directory to record the sound, I right click in the blank white area. But I find no related things in the subdirectory of "Add" . I think I can do this in "XP". How can I do this in windows 7?
Sound & Audio
Open current wallpaper in Windows 7
I love the new feature that lets you select a bunch of pictures and windows 7 will rotate them automatically in your background. Sometimes, I just want to open that picture to know some info about it. Is there a way to open the current wallpaper? I really hate having to go through my whole...
Customization
Open Link With Current Browser
Greetings; I run three browsers, with Pale Moon x64 (FFx fork) as my default, with IE 11, and SRW Iron as my secondaries. My issue is when I select a link on IE 11 or Iron, it opens the link in Pale Moon x64. What I'd like is to open a link in the current browser, not the default browser....
Browsers & Mail
New folders opening behind current folder please help
Hi All, I have windows 7 64bit and today I installed objectdock plus 2. All of a sudden when I open a folder which has links and select a link the new folder opens underneath the current folder. Does anyone have any idea on how I can fix this apart from removing objectdock? Cheers
Customization
The current user does not have privlidges to open this data file! Huh?
I built this machine a while back and I've had this appear a few times. I am the only one who uses the computer and as far as I know everything is set as administrator. These files were on an external USB drive and I was trying to open them from there. I checked permessions and it appears there...
General Discussion
New applications opening under current window
I don't know quite how to describe this problem other than saying that when I open a new window (office, or any other software), it will open up but appear underneath whatever other window I have focused already. This is especially annoying because it doesn't seem to have been doing this prior to...
Software

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 12:30.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App