473,507 Members | 2,472 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there a way to bind the ms access record selector to an unbond text control.

2 New Member
Hi basically I want to use the ms access forms record selector to navigate records in an unbound text control. Is there a way of doing this?
Jul 14 '11 #1
2 2435
Rabbit
12,516 Recognized Expert Moderator MVP
I'm assuming you're talking about an unbound and not just an unbound text box. You'll have to create your own navigation buttons. Using an unbound form to navigate a recordset is completely antithetical to what it's supposed to be used for.
Jul 14 '11 #2
Adnan Halai
2 New Member
Hi Rabbit, thanks for your response. Infact, I did just that but now I am stuck with a little problem can't seem to get out of.
I am using Access 2007 BTW. Using VBA I am able to navigate the records with my own custom navigation button, but the problem is that to navigate i am using recordset.clone. The problem with this method is that suppose I am on a field called ID which has the value of 5. Then when I click on the New button I add 1 to last value that is on the table MyDetails & save the record. But when I navigate using move previous ( for instance ) in my custom navigation the record jumps to ID 4 when infact it should have gone back 1 record say e.g. ID 31. How can I correct this. Here is my code. Can you tell what I am doing wrong here.

Private Sub cmdSave_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("MyDetails", dbOpenDynaset)

With rs
'Set the Index
.FindFirst "ID = " & txtID
If rs.NoMatch Then
.AddNew
!ID = txtID
!FirstName = txtFirstName
!FirstName = txtFirstName
!LastName = txtLastName
Age = txtAge
.Update
MsgBox "" & rs.AbsolutePosition
Else
.Edit
!ID = txtID
!FirstName = txtFirstName
!FirstName = txtFirstName
!LastName = txtLastName
!Age = txtAge
.Update
End If
End With

'rs.Bookmark = rs.LastModified
Me.txtFirstName.SetFocus

End Sub


Private Sub cmdMovePrevious_Click()
On Error Resume Next

Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.Bookmark = rs.LastModified

If rs.BOF Then
rs.MoveFirst
'DoCmd.RunCommand (acCmdRecordsGoToPrevious)
Exit Sub
Else
rs.MovePrevious
End If


txtID.Value = rs!ID
txtFirstName.Value = rs!FirstName
txtLastName.Value = rs!LastName
txtAge.Value = rs!Age

Set rs = Nothing

End Sub
Jul 16 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1461
by: NancyASAP | last post by:
In case anyone hasn't seen this problem, just sharing the info.... I created a dotnet 1.1 page with a literal control. I used a streamreader to open a text file to fill the control. I filled the...
3
13805
by: Michael Charney | last post by:
I have a form where records are entered. I have turned off the built in record control. I created buttons to advance and go back through the records as well as an add new record button, but I also...
6
2753
by: Megan | last post by:
I'm using an unbound combo box on a form as a record selector. I'm using the combo box to choose certain types of music, i.e. Alternative, Pop, Rock, etc…and then run a report based on the...
7
2250
by: Megan | last post by:
Hi everybody- I inherited a database that somehow uses a bound combo box as a record selector. Let me give you some background. The form is based on data from 2 tables. The first table, Person,...
3
1618
by: Briton | last post by:
Hi all, I got a form with 2 unbound textfields. There are also other fields that are bound to a table. When I move between the records by click'ing the recordselector, I want to update the 2...
1
1672
by: Gt394 | last post by:
I have the following tables. tbl_customer CustID Primary key Custname Custaddr tbl_Quote QuoteNo Primary key ProjectName
0
3619
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a...
2
2555
by: tlyczko | last post by:
Hello, I'm experimenting with Stephen Lebans' Rich Text Control for doing RTF data entry into a memo field. I imported the table, form, toobar, and modules from the A2k version into an A2k3...
12
5225
by: Michael R | last post by:
I've found out in Access's help that there is a Scrolling Text Control in the toolboox. I don't find it in my Access though. Strange huh? Does anyone uses it? Thanks for help.
10
34161
by: jschmidt | last post by:
All, I am trying to have something happen on a form whenever the record selectors are clicked. This is access 2003. I tried the form's click event and that does not work at all. Anyone know...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7034
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5045
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.