Hi All
I have two issues to put forward.
First is bookmarking / or highlighting a particular record in a form. The form is continuous and the records are from a query result. One of the record in that form will be always the last added record from the table. The form display the records in a sort order from the query. What i need is to highlight or bookmark a particular field of that record (the last record added) whatever the position of the record in the form to get the user's attention to this record.
Second issue is in the same form when it opens with the records i want to perform a calculation automatically and update one of the field with the new result and save the updated record.
I already mention that the form displayes query result.
There are two date fields/controls and three time fields/controls.
The calculation need to be based on the dates and two time fields and the time need to be updated as per the calculation perofrmed.
The calculation can be done after the form loaded and can place command button to perform this action.
Please guide me how to achieve this.
Thank you all
11 6498 ChipR 1,287
Recognized Expert Top Contributor
To highlight a particular record, you can add a field to your table/query and mark that record as true and the rest false. Then, do conditional formatting based on that field.
For your second issue, is there any reason you can't run an update query?
Hi ChipR
Sorry for the late reply. I think my explanation about the issue is not clear. I would like to explain because with your answer i am nowhere reaching for the result. What i am doing is adding records to a table through a form and on click of a button from that form it opens another form which is a result of a query and that form contains few other records and the last added record. But the records are in a sort order already by a time field from the query. So I want to get focus on the record which is added last in the table. Now the focus is always on the first record of the form. I been searching net about the bookmark and recordclone things but i am not sure what would solve the issue.
Please help
Thank you
ChipR 1,287
Recognized Expert Top Contributor
I see what you mean. You don't want to highlight the record, you just want to select it. Is the time field in the query the time the record was created, or some other unrelated time? Is the record you want to move to the last record of the recordset, or do you need to find it based on some other criteria?
Hi
Thank you for prompt reply.
My table has few time fields related to each record. My Main form is used to enter new data to the table and the time field is an entry by the user.. That is an unbound form. Once the user finish the entry of a new record he click a button which add the record to the table and it opens another form. The second form record source is a query. This form display the records as per the criteria in query. The second form always contain the currently added record also. This record will be placed according to the sorted time filed. But I want either the cursor focus on this particular record or highlight any filed of that record wherever the position of that record in the second form when the second form opens. Waiting for your reply
Thank you
ChipR 1,287
Recognized Expert Top Contributor
What is the primary key by which you can find the new record in the form that is opened?
Hi
So fast. Thank you
There is no primary key, but the main form is still kept open and one field is unique say field name as NAME and the NAME field value is still available in the main form. The second form also has the same field.
So while opening the second form it can be used as a reference
ChipR 1,287
Recognized Expert Top Contributor
I'll have some code you can use in a second. Would the NAME field be text or number?
ChipR 1,287
Recognized Expert Top Contributor
Ok, I would suggest using the OpenArgs argument to the DoCmd.OpenForm to pass the NAME to the new form. - 'OpenArgs is the 7th argument to DoCmd
-
DoCmd.OpenForm "Other Form Name", , , , , , Name
-
-
'In the newly opened form
-
Private Sub Form_Open(Cancel As Integer)
-
On Error GoTo ErrorHandler
-
-
Dim rs As Object
-
-
If Not IsNull(OpenArgs)
-
Set rs = Me.RecordsetClone
-
rs.FindFirst "NAME = """ & OpenArgs & """"
-
If Not rs.nomatch Then
-
Me.Bookmark = rs.Bookmark
-
End If
-
End If
-
-
ExitCode:
-
Exit Sub
-
-
ErrorHandler:
-
MsgBox "Error Number: " & Err.Number & vbcrlf & "Description: " & Err.Description
-
-
End Sub
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Bookmark |
last post by:
I have a form that does a few things, such as collect
data and than using cdonts emails this data to a place to
be parsed.
I need to add a bookmark command to this form. I have a
javascript one, but i would like to keep entire page asp.
Do you know where i can find an asp program i can add to
my form so i can do this, or am i stuck with using
javascript?
|
by: Targa |
last post by:
After I submit a form from a popup window, I use the following code to close
the popup and refresh the parent window.
<a href="#" onclick="window.opener.location.reload();self.close();return
false;">
The link to the popup window is at the bottom of the parent page (long) and
I jump to it with a bookmark. Currently, after the refresh occurs, the
parent page ends up back at the top. Is there a way to adjust the above code
(or use a...
|
by: Danny J. Lesandrini |
last post by:
The following code works with a standard MDB to navigate
to a particluar record (with a DAO recordset, of course)
but it's giving me problems in an ADP I'm working on.
Dim rs As ADODB.Recordset
Set rs = Me.RecordsetClone
rs.Find "=" & lngContractID
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
I must site the Heisenberb Uncertainty Principal here, as it
|
by: Thelma Lubkin |
last post by:
With Me!PERSONSLIST.Form.RecordsetClone
.FindFirst strID
If .NoMatch Then
Debug.Print "key " & Key & " nomatch"
Exit Sub
Else
If Me.Dirty Then Me.Dirty = False
Debug.Print "A_LOAD bookmark = " & .Bookmark
Debug.Print "A_LOAD cloneKey = " & .Fields("PrimKey")
' Me.Bookmark = .Bookmark
|
by: Len Robichaud |
last post by:
I wrote the code below to be called by a button on an open form (that has a
subform) when we need to create a new (Ghost) record using some of the
fields from the existing (current) record.
The form is based on a query that filters the form's recordset. The
environment changes rapidly so the number of "valid" records can change from
the time the form is opened to the point the recordset is requeried.
This code allows the user to add a...
| |
by: Kaur |
last post by:
Hi,
I am having a strange bookmark problem. I have a main form called
frmSurveyQSubQ. This form has a subform called sfrmRespodent.
SfrmRespondent has a sfrm in it called sfrsfrmResponses.
I have a list box on main form called lstQuestion that displays all the
questions relevant to a survey. Clicking on a question in it fills the
second list box "lstSuquestion" with relevant sub questions for
selected question in lstQuestion on main...
|
by: zzapper |
last post by:
Hi,
I use an internal bookmark
<form method="post" action="${form_action}#mark1">
to return to the correct place in the page.
In case of an error I would wish to return to the top of the screen
can I overrule the bookmark "mark1" in my PHP code?
|
by: Tom Clavel |
last post by:
I need to make sure that I am on a different record than I just was
on, in a DAO recordset.
code fragment:
1. strFind = "thisSource = " & tripID & " AND thisTrip = " & tripID
2. rs.FindFirst (strFind)
3. If Not rs.NoMatch Then
4. strBookmark = rs.Bookmark
5. rs.MoveFirst
|
by: eighthman11 |
last post by:
using Access 2003 and sql server version 8.0
Hey everyone. Created a text box where the user types in an Inventory
number and it takes them to that inventory number on the contimuous
form. The form is based on a link table to sql server. Here is the
code:
Dim rst As DAO.Recordset
Dim InventoryItem As String
InventoryItem = "'" & "TextBoxValue" & "'"
|
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...
|
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,...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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 we have to send another system
| |