|
-
Apr 19th, 2005, 10:43 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Access Set Record Selector
Hey there,
i have an main access form which calls a second form.
the second form record source is based on a table.
this form has record selectors in it and i want to know how is it possible to pass the table key to that form so i can set the record selector to be on that record
cheers
Last edited by Strider; Apr 20th, 2005 at 11:10 AM.
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Apr 19th, 2005, 11:41 AM
#2
Re: Access Set Record Selector
When you say that your main form calls another form, do you mean its a subform or it opens a
secondary regular form?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 19th, 2005, 12:19 PM
#3
Thread Starter
Fanatic Member
Re: Access Set Record Selector
its open a second regualar form.
i was wondering if using a global variable in a module, settings that to the record id i want to show and then on the form load/got focus method set the selected record.
is that possible, how can you set the selected record
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Apr 19th, 2005, 02:23 PM
#4
Addicted Member
Re: Access Set Record Selector
open the form with a filter applied:
VB Code:
DoCmd.openForm "frm2ndForm",acNormal,,"[REF NUM] = forms!frm1stForm!txtRefNum"
if you fail to plan, you plan to fail
-
Apr 19th, 2005, 04:54 PM
#5
Thread Starter
Fanatic Member
Re: Access Set Record Selector
by record selector i meant be able to set the record shown in the navigation buttons
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Apr 19th, 2005, 06:11 PM
#6
Re: Access Set Record Selector
So if you wanted to get the record id of 100 and its the 100th record also then in your second form it would
show record 100 and show it as the 100th record too? Or just show record 100 and it be the only one (filtered)?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 20th, 2005, 03:43 AM
#7
Thread Starter
Fanatic Member
Re: Access Set Record Selector
thats a lot of 100s and records.....
the first one,
when the button is clicked on the 1st form (id = 100) then on the second from it will set the selected record to be 100.
but im also hoping for the user to be able to use the navigation buttons to view other records...
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Apr 20th, 2005, 06:33 AM
#8
Addicted Member
Re: Access Set Record Selector
use the goto record method:
i put this together quickly, form2 has a combo box with numbers, i select a number and it runs the below.
seems to work as you want. just put it into the button code and replace the combo part with the name of your text box that holds the relevant ID number
VB Code:
DoCmd.OpenForm "Form1", acNormal
With Forms!Form1
DoCmd.GoToRecord acDataForm, "form1", acGoTo, Forms!form2!Combo0.Value
End With
if you fail to plan, you plan to fail
-
Apr 20th, 2005, 11:06 AM
#9
Re: Access Set Record Selector
Br1an_g's code is what you need but I would suggest a design change. If your using a main form, with say
1000 records, and you select one record to display in another form and give the user tha ability to navigate to
any other record, then whats the point of the second form, its a duplicate of the first?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 20th, 2005, 11:10 AM
#10
Thread Starter
Fanatic Member
Re: Access Set Record Selector
the second form is used to show related data from a second table
i got it working using the design component when you add a command button to the form seems toi work good
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|