Listbox

lgatinoi

Registered User.
Local time
Today, 09:26
Joined
Oct 26, 2007
Messages
27
Hello,

I have a form with a listbox, This listbox select data from a table. What I want to do is when I double click on a line it popup a form with the info in order to update the information and to save it in my table,

any idea

See attachement

LG
 

Attachments

Do you have an ID field in the list box if so you can use a macro on the double click to open a form with a condition where the tableNameIDField has been selected
 
You could use the WhereCondition of the DoCmd.OpenForm method to of your form filtered to the appropriate record.
 
Do you have an ID field in the list box if so you can use a macro on the double click to open a form with a condition where the tableNameIDField has been selected


Yes I have, so I need to write a vba to open a new form with the detail inwhere the itemselected = IDfield?
 
Hi and if I whant to open the form with the Item selected but in a crosstable form, and then update the info, close and save and it has change the table ?
 
Hi, I posted an aexample of my DB to better understand what I'm trying to do, for the actual form I would like to use only one table and simplify my query instead of using 4 or 5 table... any advise will be wellcome
 

Attachments

You have no naming convesion to your database, you would need to indicate which is your form you want someone to look at.

Basically naming rules

Tables begin with tbl
Queries begin with qry
Forms begin with frm
Reports begin with rpt

If temp tabels are created use something like ztbl

Example
tblProducts
tblStaff

frmStart
frmStaff

qryStaff
qryProducts

rptStaff
rptProducts
 
Ok, but in what these naming will help me to do what I'm trying to do?
 
They assist in tracking through your database as you would have recognisable names that other people (assistant developers) would be familiar with. As the database is partly built don't change them now, but explain in your thread please which forms you want someone to look at and which tables, queries they relate to.
 
Right; sorry I'm not used to about the forum, so I learn in the same time I built my DB...

Forms I'm trying to get something userfriendly is

V1_ActualOverview

He is related with the V54_QRYActualOverview and the table it concern is V_Actual

So the thing is I need to keep an historic of my actual and for the current period to update if we have new Headcounts , ilnesses or leaving and calculate a new actual. Then I'll stored when I close the period the V_Avtual table int V_Actual History table
 
Hello,

I've tried to write this macro for V1_ActualOverview that when I double click into the listbox it open an other form for editing data, but I don't have filter on item selected...

Private Sub ListActual_DblClick(Cancel As Integer)
On Error GoTo Err_Exit_Click
Dim strIDs As String
Dim strSQL As String
Dim varSelect As Variant
For Each varSelect In Me.ListActual.ItemsSelected
strIDs = Me.ListActual.ItemData(varSelect)
Next

DoCmd.Close
DoCmd.OpenForm "V_Actual subform", acFormDS, , strIDs, acFormEdit
DoCmd.Maximize
Exit_Exit_Click:
Exit Sub
Err_Exit_Click:
MsgBox Err.Description
Resume Exit_Exit_Click
End sub
 
Right; sorry I'm not used to about the forum, so I learn in the same time I built my DB...

Forms I'm trying to get something userfriendly is

V1_ActualOverview

He is related with the V54_QRYActualOverview and the table it concern is V_Actual

So the thing is I need to keep an historic of my actual and for the current period to update if we have new Headcounts , ilnesses or leaving and calculate a new actual. Then I'll stored when I close the period the V_Avtual table int V_Actual History table

Which form should the V1_ActualOverview with the list box open? You shouldn't have to write VBA code to open the form, although Error handling is always useful to add, a macro will deal with this, just let me know which form needs to activated after the double click.
 
Which form should the V1_ActualOverview with the list box open? You shouldn't have to write VBA code to open the form, although Error handling is always useful to add, a macro will deal with this, just let me know which form needs to activated after the double click.

Needs to activate V_actual subform; in order to update the info and to save it again and come back to the form V1_ActualOverview
 

Users who are viewing this thread

Back
Top Bottom