473,385 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Open Form, based on a table, to specific record from another form

I have a LOANS table that has a list of loan details for different
borrowers. I have a main switchboard with a LOANSELECT combo box
(that displays a list of borrower last names and loan numbers). I'd
like to be able to have a user click on the say, RECEIVE PAYMENT
button that will open the payments form. This form should open to the
loan that was selected from the LOANSELECT box. This form also has a
box on it to switch to different loan, so I can't use a query or a
DoCmd.OpenForm, as this only passes the selected record to the second
form.

I've been trying to get the FindFirst command to work, but can't seem
to do it. Here's what I've got as code for the second form.

Private Sub Form_Load()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[LoanID] = " & Str(Nz(Forms!SWITCHBOARD.LoanSelect,
0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

I greatly appreciate any help that anyone can give and forgive my
novice ability. Thanks!

Apr 29 '07 #1
6 3515
Is [LoanID] a number or a string?

Markus_989 wrote:
>I have a LOANS table that has a list of loan details for different
borrowers. I have a main switchboard with a LOANSELECT combo box
(that displays a list of borrower last names and loan numbers). I'd
like to be able to have a user click on the say, RECEIVE PAYMENT
button that will open the payments form. This form should open to the
loan that was selected from the LOANSELECT box. This form also has a
box on it to switch to different loan, so I can't use a query or a
DoCmd.OpenForm, as this only passes the selected record to the second
form.

I've been trying to get the FindFirst command to work, but can't seem
to do it. Here's what I've got as code for the second form.

Private Sub Form_Load()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[LoanID] = " & Str(Nz(Forms!SWITCHBOARD.LoanSelect,
0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

I greatly appreciate any help that anyone can give and forgive my
novice ability. Thanks!
--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200704/1

Apr 29 '07 #2
Is [LoanID] a number or a string?

Markus_989 wrote:
>I have a LOANS table that has a list of loan details for different
borrowers. I have a main switchboard with a LOANSELECT combo box
(that displays a list of borrower last names and loan numbers). I'd
like to be able to have a user click on the say, RECEIVE PAYMENT
button that will open the payments form. This form should open to the
loan that was selected from the LOANSELECT box. This form also has a
box on it to switch to different loan, so I can't use a query or a
DoCmd.OpenForm, as this only passes the selected record to the second
form.

I've been trying to get the FindFirst command to work, but can't seem
to do it. Here's what I've got as code for the second form.

Private Sub Form_Load()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[LoanID] = " & Str(Nz(Forms!SWITCHBOARD.LoanSelect,
0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

I greatly appreciate any help that anyone can give and forgive my
novice ability. Thanks!
--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200704/1

Apr 29 '07 #3
On Apr 29, 3:36 pm, "ruralguy via AccessMonster.com" <u12102@uwe>
wrote:
Is [LoanID] a number or a string?

Markus_989 wrote:
I have a LOANS table that has a list of loan details for different
borrowers. I have a main switchboard with a LOANSELECT combo box
(that displays a list of borrower last names and loan numbers). I'd
like to be able to have a user click on the say, RECEIVE PAYMENT
button that will open the payments form. This form should open to the
loan that was selected from the LOANSELECT box. This form also has a
box on it to switch to different loan, so I can't use a query or a
DoCmd.OpenForm, as this only passes the selected record to the second
form.
I've been trying to get the FindFirst command to work, but can't seem
to do it. Here's what I've got as code for the second form.
Private Sub Form_Load()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[LoanID] = " & Str(Nz(Forms!SWITCHBOARD.LoanSelect,
0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
I greatly appreciate any help that anyone can give and forgive my
novice ability. Thanks!

--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.comhttp://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-access/2007...- Hide quoted text -

- Show quoted text -
[LoanID] is an Autonumber from the LOANS table.

Apr 30 '07 #4
There are several ways to achieve what you want and you are using one of them.
Why not put a MsgBox in your next form and see what you are looking up?

MsgBox Str(Nz(Forms!SWITCHBOARD.LoanSelect,0))


Markus_989 wrote:
>On Apr 29, 3:36 pm, "ruralguy via AccessMonster.com" <u12102@uwe>
wrote:
>Is [LoanID] a number or a string?
[quoted text clipped - 31 lines]
>>
- Show quoted text -

[LoanID] is an Autonumber from the LOANS table.
--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via http://www.accessmonster.com

Apr 30 '07 #5
On Apr 30, 9:05 am, "ruralguy via AccessMonster.com" <u12102@uwe>
wrote:
There are several ways to achieve what you want and you are using one of them.
Why not put a MsgBox in your next form and see what you are looking up?

MsgBox Str(Nz(Forms!SWITCHBOARD.LoanSelect,0))

Markus_989 wrote:
On Apr 29, 3:36 pm, "ruralguy via AccessMonster.com" <u12102@uwe>
wrote:
Is [LoanID] a number or a string?
[quoted text clipped - 31 lines]
- Show quoted text -
[LoanID] is an Autonumber from the LOANS table.

--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted viahttp://www.accessmonster.com
I've done that and it returns the correct value (the LoanID from the
prior form). I just can't seem to get the FindFirst line to work
correctly. I always just retuns the first field in the Loans table...

May 1 '07 #6
Use DAO:

Private Sub Form_Load()

' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[LoanID] = " & Str(Nz(Forms!SWITCHBOARD.
LoanSelect,
0))
If Not Me.RecordsetClone.NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
End If

End Sub
Markus_989 wrote:
>On Apr 30, 9:05 am, "ruralguy via AccessMonster.com" <u12102@uwe>
wrote:
>There are several ways to achieve what you want and you are using one of them.
Why not put a MsgBox in your next form and see what you are looking up?
[quoted text clipped - 16 lines]
>>
Message posted viahttp://www.accessmonster.com

I've done that and it returns the correct value (the LoanID from the
prior form). I just can't seem to get the FindFirst line to work
correctly. I always just retuns the first field in the Loans table...
--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via http://www.accessmonster.com

May 1 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

55
by: Steve Jorgensen | last post by:
In a recent thread, RKC (correctly, I believe), took issue with my use of multiple parameters in a Property Let procedure to pass dimensional arguments on the basis that, although it works, it's...
4
by: Dalan | last post by:
I presume that using an open recordset method is the preferred method of accomplishing what I'm trying to do. Of course, if there are other options that would work, feel free to share them. I...
14
by: Abhi | last post by:
FYI: This message is for the benefit of MS Access Community. I found that this prblem has been encounterd by many but there is hardly any place where a complete solution is posted. So I thought...
15
by: Tony Williams | last post by:
I have two forms, frma and frmb, both are for inputting new records and are based on a table, tblmonth, both have two controls, txtmonth and txtmonthlabela which are based on the fields in the...
2
by: XxLicherxX | last post by:
Hi, Can someone tell me how I can open a form to a specific record from a button on another form. Here is what I want to have happen. I have one form called Computers and another form called...
3
by: Chris | last post by:
Before I started to create table, etc to track unique form field record number assigments I thought I'd check to see if there is now a better way to do this in .NET. I have a parent form (table)...
7
by: Steve_Black | last post by:
Hello, I'm toying with the idea of loading a MenuStrip (VB.Net 2005) dynamically based on who is logged into my system. Every user has different security settings and I want to customize the...
4
by: piscogirl | last post by:
Hi all, Here's my case: I have a form: Event Form and a subform: AttendanceSubForm The user selects a name (from a Person Table) on the subform to register for the event. If the name is...
5
by: BD | last post by:
I am coding with C# in Visual Studio 2005 for a database application residing on remote MS SQL Server 2005. What I want to do is open the same form but from 2 different places and only one...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.