473,387 Members | 3,801 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.

combobox, textbox-synchronization ?


I have several forms hierarchycaly nested in each other
(form/subform/subform/subform....).
The final form is "continous form", while parent forms are single forms
through which navigation was performed by navigation buttons.
Now I want to enable navigation through records both by navigation buttons
and COMBOBOXES. Therefore I added comboboxes besides textboxes.
Let's suppose that txtAAA is textbox and cbxAAA is cmbobox. My aproach was
following:
' Events on the form:

' 1. On Load event fills combobox with the first value

Private Sub Form_Load()
cbxAAA = cbxAAA.ItemData(0)
End Sub

' 2. On Current event synchronizes combobox value with current record in the
form (represented by txtAAA)

Private Sub Form_Current()

Me.cbxAAA.Requery

For i = 0 To cbxAAA.ListCount
If cbxAAA.ItemData(i) = Me.txtAAA Then
Me.cbxAAA = cbxAAA.ItemData(i)
Exit For
End If
Next i

End Sub

' On the COMBOBOX istelf we have After Update event which synchronizes
current record (txtAAA)
' with the value selected from the combobox.
Private Sub cbxAAA_AfterUpdate()

With CodeContextObject
DoCmd.GoToControl "txtAAA"
DoCmd.FindRecord .cbxAAA, acEntire, False, , False, acCurrent, True
End With

End Sub
This works perfectly as long as both textbox and combobox are visible. But,
my intenion was to hide textbox.
Unfportunately, when I put property txtAAA.Visible=False, the above
mentioned After Update event generates an error, because Find method
requires an object focus and hidden object can't have focus...
What is the alternative solution ?

Thanks.

Nov 13 '05 #1
2 2698
try to make it locked instead of hiding

Madhivanan

Nov 13 '05 #2
No problem with that...but I want it to be invisible...

"Madhivanan" <ma************@gmail.com> je napisao u poruci interesnoj
grupi:11**********************@o13g2000cwo.googleg roups.com...
try to make it locked instead of hiding

Madhivanan

Nov 13 '05 #3

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

Similar topics

5
by: Steve | last post by:
I have an unbound combobox in the form header of a continuous form. The selection in the combobox sets the where clause in a querydef which determines QryPFrmInventoryManagement. The following code...
8
by: Zlatko Matię | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
5
by: Quan Nguyen | last post by:
How can I obtain the textbox (editing field) control of the combobox? I tried combobox.Controls to obtain the collection of controls that the combobox contains but it turned out to be empty. Thanks.
3
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article:...
0
by: Ken Arway | last post by:
Using .Net framework 1.1 I've got a Windows Forms application with a tab control having four tab pages. TabPage4 contains a Combobox and a TextBox, which are bound to the same XML file as a...
30
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
1
by: polocar | last post by:
Ciao a tutti, leggendo qua e lą per il forum ho scoperto che non sono l'unico ad avere questo problema. Se si inserisce un controllo ComboBox in un form di C#, non č possibile impostare la sua...
1
by: Ferdinand Zaubzer | last post by:
Hello, I am trying to insert some Text via drag and drop into the editable area of a combobox. The problem is, that I can't get the current charIndex of the selected Text via the mouse cursor...
2
by: DesCF | last post by:
I have a textbox and a combobox on a toolstrip. The user enters either an ID in the textbox or selects a name from the combobox. When the user selects a name from the combobox the textbox is...
1
by: billypit | last post by:
Hi, I am totaly new to MS Access. I have one form in MS Access in which i want that whenever i select an item from combobox then in the textbox on the same form or subform i want value from table...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.