473,471 Members | 2,089 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Move focus to row where duplicate item was originally captured

547 Contributor
I use this code to identify and delete new duplicate records, when as it is captured.
I would like to Move the focus then to the row where a duplicate item was originally captured, in the subform (maybe a few lines up).
Expand|Select|Wrap|Line Numbers
  1. If DCount("[acquireid]", "tblAcquire", "acquireid<>" & acquireID & _
  2.         " AND Client_lookup=" & Client_lookup & _
  3.         " AND Item_Lookup=" & Item_Lookup & " AND Order_No=" & Order_no) > 0 Then
  4.     msg = "This is a duplicate ICN code for this Facility Order. Please do not add duplicate entries" & vbNewLine
  5.     msg = msg & "The record will now be undone"
  6.     MsgBox msg, vbExclamation, "System Duplication Message"
  7.     Me.Undo
  8.     Cancel = True
  9. End If
Please assist
Aug 7 '14 #1
3 978
NeoPa
32,556 Recognized Expert Moderator MVP
Depending on your exact requirement, you can use :
  1. Call DoCmd.GoToRecord() to set the focus to the desired record.
  2. {SomeControl}.SetFocus() to set the focus to the desired control.
  3. {SomeForm}.SelTop to scroll the records within the visible list.
  4. {SomeForm}.Painting = True/False around your code to avoid visible flicker.
Hopefully, with these tools, you have all you need to handle your situation.
Aug 7 '14 #2
neelsfer
547 Contributor
thx Neopa will give a try
Aug 7 '14 #3
NeoPa
32,556 Recognized Expert Moderator MVP
Let us know how you get on. It can be fiddly, but with attention to the detail you can do all you want.
Aug 7 '14 #4

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

Similar topics

7
by: mcanedo | last post by:
Hi: I have several text elements in a form. Some of they are filled by the user, and then some are automatically filled based on the user input. Therefore I do not want the user to be able to...
2
by: Jay Villa | last post by:
I have a SSN Field which include 3 text boxes. How do I move the focus from one box to another as soon as user enter the max characters in the text box. For example: when users enter 123 in the...
4
by: MLH | last post by:
HelpBox is a textbox control on a form. When line #254 is processed, the focus is on HelpBox. However, when line #254 executes, the error saying 'can't move focus to ButtonG' is returned. I've...
0
by: lauren quantrell | last post by:
Is there a way to set the focus to an Access 2K toolbar? After maximizing a form my toolbar now floats under the maximized form and I need it on top. lq
0
by: Mynfred | last post by:
Hi, all, I found a strange question about OCX in VB.net, the OCX is crearted by VC++.net, and I put it on the VB.net Form, in OCX, there are many edit box, on the VB.net form, there are many...
1
by: Heather Crow | last post by:
I have a VS.NET 2003 Visual Basic form which keeps hanging. It does not appear to matter what textbox I am on. When trying to edit the field I cannot move focus from this field to another. Clicking...
2
by: Paul Remblance | last post by:
I am trying to use the bindingnavigator addnewitem button to place the focus on the first cell in the newrow row. I have disabled the default action and I am using the bindingnavigatoraddnewitem...
1
by: patskinny | last post by:
I have a combo box in which a user can select a number of "1" or "0". if the user selects "1" it changes the visible property on other controls that were initial set to "Flase" to "True" . the...
7
by: kiwipedia | last post by:
Hi all I have a combo-box control which I've set as a required field. It's a date and uses a calendar as coded below. All works fine unless the user deletes a pre-existing value (leaving a...
2
by: raviryada | last post by:
hi friends, iam getting this problem during html loading "can't move focus to the control because it is invisible,not enabled,or of a type of that doest not not acceptthe focus" pls help me
0
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...
0
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...
0
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...
0
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,...
0
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.