|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Scratching my head over this please help
Please see attached zip files I'm creating a insurance database but unlucky at the following.
I been trying link the number of the addin inusrance with the text box called insurance. Example user type #1 and the insurance Blue Cross appears in the txt box. Also been trying to create a double click event procedure whereby user double clicks the text box called insurance to search already entered insurances please help with coding. |
|
#2
|
|||
|
|||
|
You might try creating a combo box on your screen that looks up the values you are looking for and populates the fields. Set the .visible property for the combo box to false.
on the double click event of the text box write your code to make the combo box visible and the text box invisible. in the after update event of your combo box, you add in code to make the combo box invisible again and the text box visible. Dont forget your set focus commands because you cant set the property of an object to invisible while the object has the focus. The following example uses a text box as you are using currently and is identified as [Account]. I have added a combo box identified as [combo1]. When you double click on the text box it makes the combo box visible, moves the focus and makes the text box invisible. Once you select the option you want from the combo box, it makes the option you selected the current record, makes the text box visible, moves the focus to it, and then makes the combo box invisible. Option Compare Database Private Sub Account_DblClick(Cancel As Integer) Combo1.Visible = True Combo1.SetFocus Account.Visible = False End Sub Private Sub Combo1_AfterUpdate() ' Find the record that matches the control. Dim rs As Object Set rs = Me.Recordset.Clone rs.FindFirst "[Key#] = " & Str(Nz(Me![Combo1], 0)) If Not rs.EOF Then Me.Bookmark = rs.Bookmark Account.Visible = True Account.SetFocus Combo1.Visible = False End Sub Last edited by Slick Willy : July 31st, 2005 at 10:16 PM. Reason: Add code |
|
#3
|
|||
|
|||
|
Thank you
|
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Scratching my head over this please help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|