473,781 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Performing actions based on a specific record

I have two problems I am trying to solve.

1) I am needing to be able to double-click on a list and have it open
another form with the details. I will need the detailed form to be a
stand alone form, so I don't think I can use a sub-form. I've looked
through the group listings and can't seem to find a solution that
doesn't use a sub-form solution. Was thinking the SelTop or
CurrentRecord commands would do what I want, but can't find any code
examples that use it. Thinking I could attach some VB code to the
double-click and use the where function of a query to filter the
results in the detailed form. Hoping someone who's done this could
help!

2) I figure this one is easier and that I'm just not calling it the
proper name when I'm searching newsgroups, so I apologize if it's
already been asked. I have a form that allows users to look at each
record, one at a time by clicking the "play/fast-forward, rewind, etc"
buttons (forgot the formal name for it -- sorry). This can be
cumbersome if there are 1000s of records though, so I'm trying to give
the end-user another way to get to the record they need. I've added a
list box that shows all of the unique ID numbers. I'd like, as the
user goes forward/backward a record at a time, for the ID number in the
list box to be highlighted. Conversely, I'd also like for the user to
be able to highlight a record in the list box and have the form go to
that particular record.

I'm new to programming with Access and don't necessarily have the lingo
down, so I'm probably just not searching on appropriate key words. Any
help (with examples) would be greatly appreciated.

Thanks,
Lisa

Mar 20 '06 #1
3 1431
More information:
On the second problem, when I make the controlsource equal to the
"ID Number", it seems to half work (i.e. when I click through the
entries, the list box shows the appropriate id number). However when I
click on a different record in the list, my form thinks that I am
changing the value of the current record. As a result, I get the
following error: "The changes you requested to the table were not
successful because they would create duplicate values in the index,
primary key, or relationship... .", which makes sense. Is there a way
circumvent the form thinking that I'm wanting to change the current
record?... maybe using the "before update" function?

Again.. thanks for the help.

Lisa

Mar 20 '06 #2
Ok, I've been playing a little more with my problem #1 listed at the
beginning of this thread. In trying to identify the record
highlighted, I wrote the following code:

Private Sub CapMatList_Clic k()
Dim strDesiredFunct Query As String
Dim ctl As Control
Dim varItm As Variant, intI As Integer

Set ctl = Me.CapMatList

For Each varItm In Me.CapMatList.I temsSelected
For intI = 0 To ctl.ColumnCount - 1
If (intI = 0) Then
strDesiredFunct Query = "Select [Request
Breakdown].[Details] from [Request Breakdown], [Capability Import]
where [Request Breakdown].[Capability]=""" & ctl.Column(intI , varItm) &
""""
Me!DesiredList. RowSource = strDesiredFunct Query
Me.DesiredList. Requery
Debug.Print strDesiredFunct Query
End If
Next intI
Next varItm
End Sub

This works when I have the multiselect set to Simple. However, when I
set it to None (which is what is desired), it will not go through the
loop. Any ideas?

Lisa

Mar 20 '06 #3

"Lisa Burks" <li*******@gmai l.com> wrote in message
news:11******** *************@z 34g2000cwc.goog legroups.com...
Ok, I've been playing a little more with my problem #1 listed at the
beginning of this thread. In trying to identify the record
highlighted, I wrote the following code:

Private Sub CapMatList_Clic k()
Dim strDesiredFunct Query As String
Dim ctl As Control
Dim varItm As Variant, intI As Integer

Set ctl = Me.CapMatList

For Each varItm In Me.CapMatList.I temsSelected
For intI = 0 To ctl.ColumnCount - 1
If (intI = 0) Then
strDesiredFunct Query = "Select [Request
Breakdown].[Details] from [Request Breakdown], [Capability Import]
where [Request Breakdown].[Capability]=""" & ctl.Column(intI , varItm) &
""""
Me!DesiredList. RowSource = strDesiredFunct Query
Me.DesiredList. Requery
Debug.Print strDesiredFunct Query
End If
Next intI
Next varItm
End Sub

This works when I have the multiselect set to Simple. However, when I
set it to None (which is what is desired), it will not go through the
loop. Any ideas?

Lisa



Hi Lisa
You are making it all to hard for yourself. If the listbox has no
multiselct then you can simply write:
Me.MyListBox.Va lue
Normally for a list box the first column is set to the unique record id and
the bound column is set to 1. The first column can be made invisible
(column width=0) if the id is an arbitrary value not to be seen by the user.

As for your second point with the "play/fast-forward, rewind, etc" buttons,
thes are called Navigation Buttons and their function is not really to find
records. It looks as though you are not using the most basic of Access
functionality of putting your cursor in the field you want to search by and
pressing CTRL-F.

Mar 21 '06 #4

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

Similar topics

4
1807
by: Roderik | last post by:
Is it possible to perform actions at certain moments. Like resetting a database record every first day of month? regards, Roderik
3
5078
by: Clifford Schneider | last post by:
Hello, I have several SQL Server jobs that execute procedures written to run deletes and updates against tables in my data warehouse. Some jobs occasionally get stuck with the status "Performing Completion Actions" and can only be reset by restarting SQL Server or rebooting the server. I have seen one answer to this problem in a DTS package is to check the box specifying "Close Connection on Completion" for each task. Is
1
2300
by: ammarton | last post by:
Hello all...I'm a bit new to working with Macros in Access so forgive me if the terminology I use is not accurate. To preface this, basically I am using a form on a replicated database so the end-user can filter on a specific report they want to see. This database was designed by my predecessor (of which he left no documentation) and I need to add some additional functions to this end-user filter report. Within one Macro, he has over...
1
1905
by: Will | last post by:
In Access 97 under options/edit find/Confirm - Record Changes, Document Deletions, Action Queries. Can someone tell me if these options are specific per each MDB file or are set by each PC's copy of Access? Thanks
6
348
by: Chris Fink | last post by:
I have the need to perform an atomic operation in two systems, a database and an ftp site. The process is two step; 1. insert a row into oracle, 2. delete a file from a remote ftp site. I need to make these steps atomic...either they both succeed or both fail. Any suggestions on how I create a transaction that bridges these two steps (systems) using C#? Thanks in advance!
1
3247
by: Martin Bentler | last post by:
Right now, I have a form, locked records, on which I have a CommandButton that opens a second form (much like the first) but open for editing, plus allowing the user to manipulate other areas of the data base. I want to have the second form open at the specific record I was working with on the first form. Basically what I am doing is running a find to locate the record after the second form opens, as all I have is DoCmd code to open and close...
16
6535
by: zoeb | last post by:
Hi, I am a complete novice to Access VBA and looking for some help to select a record. I am looking to perform an operation on the previous record - i.e. adding a new blank field, and then calculating the value in the new field by increasing the value in the previous record by a percentage. However, I am unsure of how to select the previous record. I though that by having a query in the background which finds the maximum record ID would work,...
36
2384
by: CK | last post by:
How do I write a set based query? I have a groupSets table with fields setId, idField, datasource, nameField, prefix, active Data: 1,someIDfield, someTable, someField, pre1, 1 2,someotherIDfield, someTable, someotherField, pre2, 1 3,somethirdIDfield, someTable, somethirdField, pre3, 1 4,somefourthIDfield, someotherTable, somefourthField, pre4, 1 I need to generate records in another table by constructing queries from the data in groups...
2
10129
by: Stratocaster | last post by:
Hello, and thank you for any help in advance. I need help determining if any commands exist in VB (Excel macro style) that can enable a user to select cells and run a macro which performs operations on those cells. I am a beginner and am not sure if this is possible. And if you'd really like to teach me a lesson. . . . Could this be iterated with a while loop? Suppose I wanted to simply make a graph of each row in a dataset and each
0
9636
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10075
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6727
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.