473,387 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Lost Focus.. basic confusion

5
Basically im an amature at this stuff as ive just started, and teacher thinks we are all young Bill Gates.

I have a main form of Examiner Details and a subform with other details. I want 1 thing in the subform to be the same as in the main form, if not displaying a message. So im not sure how to set this out... I gave this a go

Private Sub ScriptID_LostFocus()

'ScriptID must equal SubRefcode2'
If ([ScriptID] <> [SubRefCode2]) Then
MsgBox "Script ID wrong"

End If
End Sub

---------------
But nothing happens.... do i need to state the location of the fields, if so could you please post how i will succeed in doing this..
Thankyou
Mar 19 '07 #1
2 1027
balid
18
Basically im an amature at this stuff as ive just started, and teacher thinks we are all young Bill Gates.

I have a main form of Examiner Details and a subform with other details. I want 1 thing in the subform to be the same as in the main form, if not displaying a message. So im not sure how to set this out... I gave this a go

Private Sub ScriptID_LostFocus()

'ScriptID must equal SubRefcode2'
If ([ScriptID] <> [SubRefCode2]) Then
MsgBox "Script ID wrong"

End If
End Sub

---------------
But nothing happens.... do i need to state the location of the fields, if so could you please post how i will succeed in doing this..
Thankyou
If SubRefcode2 is not on the same form as ScriptID then you will need to reference the form it is on. How are you storing the values on your subform? Are you using a listbox or an array?
Mar 19 '07 #2
ansumansahu
149 100+
Basically im an amature at this stuff as ive just started, and teacher thinks we are all young Bill Gates.

I have a main form of Examiner Details and a subform with other details. I want 1 thing in the subform to be the same as in the main form, if not displaying a message. So im not sure how to set this out... I gave this a go

Private Sub ScriptID_LostFocus()

'ScriptID must equal SubRefcode2'
If ([ScriptID] <> [SubRefCode2]) Then
MsgBox "Script ID wrong"

End If
End Sub

---------------
But nothing happens.... do i need to state the location of the fields, if so could you please post how i will succeed in doing this..
Thankyou

How are you calling this sub ScriptID_LostFocus(). Is it called on some event or just when the subform loads up??

thanks
ansuman sahu
Mar 20 '07 #3

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

Similar topics

7
by: Chris | last post by:
I'm using eight links listed horizontally as a menu on my site. I'm using font-variant:small-caps and they are padded so that they mimic buttons. My gripe is with the way IE handles the focus...
6
by: Patrick De Ridder | last post by:
How do I connect to an event being thrown when a field has lost focus? Could you please give a code example? -- Patrick De Ridder ngmail@freeler.nl
0
by: thomaz | last post by:
I use the DataSource like below to fill a Combobox: comboBox1.DataSource = dataSet1.Tables; comboBox1.DisplayMember = "ProductName"; When the user types any keyboard key i use the DROPDOWN...
3
by: Tom | last post by:
I have a VB .NET application that has a text box with the following code to handle the leave event. Private Sub txtIDiscountRate_TextChanged(ByVal sender As System.Object, ByVal e As...
6
by: Ellis Yu | last post by:
Hi all, I've a form containing some textbox fields. I wrote a simple code to check if the field is blank in lost focus event, an msg box will be shown to remind user about it. But don't why the...
0
by: Nick | last post by:
I have a situation wherein i have a text box, that has abc() being executed whenever the lost focus event is triggered. However, there is an exceptional case where, if a button click causes the...
3
by: Greg | last post by:
My problem is that values in the bool column of a datagrid are only being updated to the database once the focus of the bool cell is lost. This is completely counter-intuitative. When a user clicks...
3
by: jab3 | last post by:
Hello. I"m new to this group, and to JavaScript in general, so please forgive me if I breach local etiquette. I'm trying to implement some client-side 'dynamic' validation on a form. I'm having...
3
by: hula | last post by:
Hello againe a "basic" question on UserControls. I have some UserControls inside a panel. Inside the controls i have checkboxes, comboboxes and textboxes. On change of any data inside the...
1
by: ravikumar2007 | last post by:
I am working with .NET 3.5 framework within an WPF application. I have a windows application where for a textbox, I have defined the lost focus event. I need to call the Focus() method of any other...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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
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...

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.