I know practically nothing in VB 6 and my teachers need me to do a project within a month, so i really need help!
This one form, acts as an inbox where the fields shown are- from,subject and date
the table name is msg, and the fields in that is- from, to, sub, dates, msg, read
and i've written a code in this "send message" form and it gets stored in this table
here "Username" is my global variable which has the user's id stored in it.
here's my code-
Private Sub Form_Load() Dim Getr As String Set rs = New ADODB.Recordset rs.Open "Select * from msg", cn, adOpenStatic, adLockOptimistic Getr = rs.Fields(2).value rs.MoveFirst 'While (rs.EOF = False) If Getr = Username Then Label4.Caption = rs.Fields(1).value Label5.Caption = rs.Fields(3).value Label6.Caption = rs.Fields(4).value rs.MoveNext 'rs.Close End If 'Wend rs.Close End Sub
this works in displaying only one of the messages..and i've hardcored the label boxes 4,5,6..
but since the number of messages in the inbox is more than one, i need to be able to dynamically add labels based on how many new messages i've got.
I'd really appreciate the help, and i hope i've explained my problem clearly