Pop Up Text Box

sunrunner4kr

Registered User.
Local time
Today, 22:44
Joined
Apr 24, 2008
Messages
16
Hi Everyone

Is there a way you can have a text box pop up when you hover the mouse over a record in a list? the text box would contain the data in a field from that record.

cheers
 
Simple Software Solutions

Anything is possible if you have the time and skills, however you also need forethought. If you have a large list of records and you want to hover over a record in that list and for the system to popup a window with the text in it. You would code this on the movemove event of the list box. Consider what would happen if you dragged your mouse from top to bottom of the list? It would attempt to perform the action as it passed each individual item.

You would be better off coding this on the double click of an item in the list.

CodeMaster::cool:
 
thank you

very good point!:D

can i use the expression builder to form some code for this?
 
Simple Software Solutions

Lets assume that the text you want to display is quite long and is truncated on your listbox. also lets assume it is in column 3 of your listbox and the records PK is in column 0.

Create a global variables in your startup module called MyPK, MyString

Create a new form (FrmZoom) that has a large textbox and a close button on it. Think of it as a zoom screen.

On the double-click event of the list box code the following:

Code:
MyPK = Me.ListBox.Column(0)
MyString = Me.Listbox.Column(3)

DoCmd.OpenForm FrmZoom

On the OnOpen Event of the Form enter the following:

Code:
Me.TxtZoomedString = MyString

At this point the user can read the whole string in full. Remember to set the scroll bar settings on the text box to vertical only.


If you wanted to take this a step forward and let the user edit the string and update it then you have the PK to use for your SQL (MyPK).
 
cheers

thanks again, i'm not sure what you mean by startup module? do you mean create a new blank module called 'MyPK, MyString' ?
 
Simple Software Solutions

Sorry, If you already have a module then you can use that just declare to variables named MyPK and MyString in the declarations area

Code:
Public MyPK As Long
Public MyString As String

Having declared them here they remain open for the duration of the app being open and can be referred to at any point in your application. The names and variable types that I have used are for brevity, use whatever naming conventions you want.
 
ahhh...done.

It doesn't seem to like:

DoCmd.OpenForm FrmZoom

comes up with:

Run-Time Error: '2424'

The Action or method requires a Form Name argument.
 
Simple Software Solutions

Have you got a form to open Named FrmZoom?
The name I gave you was only an example:confused:
 
yeah i called it FrmZoom

FrmZoom.GIF
 

Users who are viewing this thread

Back
Top Bottom