Hi,
My Project is in MS Access 2002.
In that I have one form which I am using for data entry.
Now in that I have some TextBoxes like
PalletNo,TotalPallets,ItemNo,LONo,PONo,BatchNo,Lot No,Cartons,PcsPerCarton etc.
Now when person scan a barcode from paper it will automatically enter Number(Like 24914) in first PalletNo TextBox.
In the AfterUpdate event of PalletNo TextBox I put some code so it will search the values of ItemNo,LONo,PONo,BatchNo,LotNo,Cartons,PcsPerCarto n etc and automatically put it in TextBoxes.and TotalPallets=1
Now again when person scan new barcode it will do the same thing as above for second PalletNo(Like 24915).But There is one more criteria that if ItemNo,LONo,PONo,BatchNo,LotNo,Cartons,PcsPerCarto n are same as it is for first PalletNo then it will TotalPallets=TotalPallets+1.and PalletNo=FirstPalletNo;SecondPalletNo(its value like this 24914;24915) and it will null the all details for second PalletNo so I can use it again. Now when it null the values i put one more line
Me.PalletNo2.SetFocus
But its not working it will go to the next TabStop.So I have to again click on previous PalletNo and scan Barcode over There.
My Form is Unbound because I didn't Use Form Wizard to creat it.
Is this possible bcz of that its not working?
One more thing I want to know that ,
I put code in AfterUpdate event of PalletNo TextBox.Now after scaning the Barcode I have to press Tab or Click on another TextBox then it will enter the value Automatically in respective TextBoxes.Is that possible as soon as i scan the Barcode and it will enter the value in PalletNo TextBox then it will automatically search for Data as per search criteria and automatically add data in TextBoxes and cursor go to the next PalletNo.So that if I scan the First barcode then it will enter data and go to the next barcode and I have to only scan another barcode.I don't have to press Tab or Click on another TextBox again and again.
If u have any suggestion then plz give me.
4 18276
OK, wow, you got alot going on here. First, you can use an IF statement in the OnExit event of a textbox to catch null values. Example: -
If isnull(TextBox1) = true then
-
TextBox2 = "" 'Returns an empty textbox
-
end if
-
Lastly, you can use Dlookup to automatically populate all of you textboxes bases on a single barcode scan and no click or tabbing. On the OnExit event of your barcode textbox, you would do something like: -
Private Sub Autopopulate()
-
Dim Pnum as integer
-
-
Pnum = dlookup("[Field Name]", "YourTableName","[Field Name] = Textbox2")
-
Pnum = Textbox8
-
End Sub
-
I sugggest doing a little research on the above mentioned stratagies,
Bender
Because of a quirk in Access, you cannot directly set focus to a control from that control's AfterUpdate event. Instead, you have to set focus to another control then set control back to the control in question: - Private Sub PalletNo_AfterUpdate()
-
Me.AnyOtherTextbox.SetFocus
-
Me.PalletNo.SetFocus
-
End Sub
Linq ;0)>
I used the same thing in my coding. The problem was that the text box I want to set focus to, already has the focus. Therefore, the command is not carried out. The way to handle this is to put a transparent command button immediately following the text box of interest in the tab order. Then a bit of code in its GotFocus event can set the focus back to the text box.
And Now its working Properly.
Thanks For Ur Replies.
Thanks. I've been agonizing over this problem for days.
Dave Denson
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Neil Ginsberg |
last post by:
OK, this is a stupid thing, but I can't seem to get this to work. I have a
form with a subform (in continuous form view). A combo box on the main form
has code in the AfterUpdate event which adds a...
|
by: Jonas L |
last post by:
Hi,
I need to create a textbox which acts as a normal textbox but with the
following extra requirements:
1) In-focus color, when the textbox gets focus the backcolor property
of the textbox...
|
by: zdavid |
last post by:
Hi,
I have a dialog box with a multiline textbox and three buttons. The
obvious thing I'm suffering with is how to give focus to the textbox,
so that when the dialogbox pops up, the user could...
|
by: SJ |
last post by:
Hi all,
I have come across a weird problem when attempting to automatically
set the focus in a vb.net form to a checkbox control...
In my form I have (on a tab page in a tab control) several...
|
by: Stefan |
last post by:
hello,
Just a sort of newbie question.
How can i change the backcolor of the controls which have the focus
(textbox/combobox/datetimepicker) and
set it back to white when they lost focus.
thanx...
| |
by: Tosch |
last post by:
I have a usercontrol with a label, a textbox, a treeview, a grid and a
couple of checkboxes.
The usercontrol is hosted on a form together with a cancel and a
accept button. This form is used to...
|
by: Praveena.Alapati |
last post by:
Hi,
There is a tab control on a page with multiple tabs and handful of
controls in each tab. The way it's rendered in html (like grid etc..)
is in table format in tablerows and cells.
On...
|
by: hugo |
last post by:
Hi,
I have a function that I call from form fields using the OnKeyUp
function to replace special caracters. Once this function has been
called, it does not set the focus on the form field where...
|
by: venkatarp |
last post by:
Hi ,
I am facing one different problem.
I have dropdown and textbox.
After i selected drop down textbox should focus.
But its disabled and not focussing......
|
by: montzter |
last post by:
Hi evryone,
I'm having trouble in formatting the inputed data in the text box so that everytime user lost focus it will adjust its value to contain the format (#,####.##). ie user will input...
|
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,...
| |
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...
|
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...
|
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,...
|
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...
|
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...
|
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 ...
|
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...
| |