thanks Matt, its of really gr8 help.
thanks Matt, its of really gr8 help.
i have a form for adding records which has few txtbxs n a listbox. i have another form which has an adodc where i wud b able2 navigate thru added records, with exactly the same txtbxs n listbox as in the add form. wat i wanna do is take the contents of the listbox in the add form n display it in the listbox in the next form.
Problem:navigating with adodc works for txtbxs but listbox returns a blank, even though data is adding fine to the database.
Question: y r contents of the listbox not showing in the nxt form, even though they r adding perfectly 2 the database.
y is my program not returning the added contents of the listbox to populate the appropriate corresponding listbox in the nxt form?
u get what i mean?
hi, am facing problems with taking contents/added items of a listbox in one form(Add) and displaying it in a similar listbox in another form(Modify) which has an adodc for navigating thru records. now i know textbox works fine but listbox is giving a hiccup...any ideas? :!:
attached is my project and i'm kinda facing problems with listbox. this is a simple project of adding, modifyind, deleting records.
In frmAdd i have a listbox which enables attachment, this is working fine as it adds to the database, however, it does not add to the other listbox in frmModify and frmDelete, where i can make changes or delete record if need to. these 2forms contain adodc to enable me to navigate through records, now textboxes r navigating perfectly but listbox is returning blanks for these 2forms.
simply:how do u take the contents of a listbox of a form and display it in another listbox in another form which has an adodc to use for navigation. am i missing out on coding?
ideas most welcome, thanx in advance.
definitely what i wanna do and as i'm just a beginner in vb6, ideas are gr8ly welcomed. any example available on how to read a filename, underline it as a link, so its easy to open! or sumthing along that line.
just simply a textbox where u can add filenames(separated by semi-colon), say from dialog box or anywhere, which should be underlined like a link, so that when u click on that filename/link, it opens the file, like its done in email attachment. am i getting thru?
any1 have any guidance with coding email attachments, like that in the email textbox, like underlined filenames so that when its clicked, it opens that file...using vb6.
i'm trying to open it like the ones in the outlook where we place email attachments(underlined) and u just click on that underlined attachment(filename) to open it. exactly what i wanna do for my textbox...where i add the filenames in my textbox as attachments, and when i double click on the filenames, it opens the lastly added item. since still learning vb6, how do i write the program to let it behave like opening email attachments..open the exact filename i click on...how do i get my filenames to be underlined so i can just click on it and it opens that document.
below is the code i'm applying to my textbox:
[Private Sub txtAttach_DblClick
If txtAttach.Text = "" Then
dlg.ShowOpen
ElseIf txtAttach.Text <> "" Then
Dim ret&
ret = ShellExecute(Me.hwnd, "Open", dlg.FileName, "", "", 1)
End If
end sub/]
i need an example on attachments in a textbox, like when u click on a command button, cmdAttach it opens up a list of files where i choose any to attach, and if i choose 2, the filenames get separated by a semicolon to distinguish them(one after the other).
if i wanna open one, i click on the filename and it should open that particular file, and if i click on the next one, then it should open that next file.
[Private Sub txtAttach_DblClick()
If txtAttach.Text = "" Then
dlg.ShowOpen
ElseIf txtAttach.Text <> "" Then
Dim ret&
ret = ShellExecute(Me.hwnd, "Open", dlg.FileName, "", "", 1)
End If
end sub/]
is there a way to open attachments displayed in a textbox, separated by a semi-colon..like an email attachment that's underlined where u just click on the link(underlined filename) and it opens that particular attachment.
i would just like to see an example...thanks!
i've attached the project, i look forward to ur assistance...as i'm in need of help! thanks in advance.
how do i post attachments here, or should i zip it, or jst paste the entire code?
the thing is i'm adding attachments from a dialog box, so say i add 3 files from there, only the 3rd file is read and displayed in the Attachment field in my database, not the other 2! nor does these added files show in my lstAttach in frmModify, even though textbox works when i navigate on my adodc.
this is what my code is like, i'm trying to add a new task and in another form, i can later modify, if i wanna make changes....i desperately need help from any1 who's willing to offer, coz i'been stuck with listbox b4 i can proceed with my project. when i add new tasks, my lstAttach doesn't show the tasks in the database and in my frmModify, i use an ADODC which works for the textboxes but not my lstAttach...any ideas? below is my code for frmAdd and frmModify..can sum1 point me in the right direction, so i can get this load on listbox off my back...!
Private Sub cmdAdd_Click()
Set wk2 = DBEngine.CreateWorkspace("MyWks", "admin", "", dbUseJet)
Set db2 = wk2.OpenDatabase("c:\Project 1\legalminder1.mdb", False)
Set rs2 = db2.OpenRecordset("addrecord", dbOpenDynaset)
MsgBox "Add Record", vbInformation, "Record"
rs2.AddNew
rs2.Fields(0).Value = UCase(txtID.Text)
rs2.Fields(1).Value = UCase(txtDefineTask.Text)
rs2.Fields(2).Value = UCase(txtDocuments.Text)
rs2.Fields(3).Value = DTPicker1.Value
rs2.Fields(4).Value = CInt(txtDays.Text)
rs2.Fields(5).Value = UCase(txtNotes.Text)
rs2.Fields(6).Value = lstAttach.Text
rs2.Update
lstAttach.AddItem NoNull(rs2.Fields(6).Value)
txtDefineTask = ""
txtDocuments = ""
DTPicker1.Value = Date
txtDays = ""
txtNotes.Text = ""
lstAttach.Clear
txtDefineTask.SetFocus
End Sub
Private Sub cmdModify_Click()
strResponse1 = MsgBox(" Do you want to Save Changes to this Record ?", vbYesNo + vbExclamation, "Record")
If strResponse1 = 6 Then
cn5.Open "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=c:\Project 1\legalminder1.mdb; Persist Security Info=false"
rs5.Open "select * from addrecord", cn5, adOpenDynamic
cn5.BeginTrans
sql = "update addrecord set " & _
"Task = '" & txtDefineTask.Text & "', " & _
"Documents = '" & txtDocuments.Text & "', " & _
"DDate = '" & …
does any1 have any idea how to link listboxes with adodc to a database?
Hi
Your code for rs3.Fields(3).Value = List1.Text has to be changeTry changing code like
rs3.Fields(3).Value = List1.list(itemnumber)'itemnumber is the element you want to assign from list box
i'm not really familiar with using itemnumber, so u mind pointing me in the right direction as i am a beginner in this field.
i have 2 textboxes and 2listboxes where List1 contains the filename and List2 has its respective path and is hidden. i have an ADODC to connect to my database, when i run program, the textboxes are populated with the records as i click on the adodc but the listbox doesn't seem to work. what i want is that when i click on the adodc and shows a particular user(record), it should also show me if i have added some email attachments in the listbox, but if there's no item in the listbox, then should just leave it blank/cleared.
below is my piece of code:
1. when i add a new user, i am able to view the person's record,name and address, but if i add some email attachments to the record, it doesn't get added to the respective field 'email' in my database. any ideas?
Private Sub cmdAdd_click()
...
Set wk1 = DBEngine.CreateWorkspace("MyWks", "admin", "", dbUseJet)
Set db1 = wk1.OpenDatabase("c:\user.mdb", False)
Set rs1 = db1.OpenRecordset("User", dbOpenDynaset)
MsgBox "Add user", vbInformation
rs3.AddNew
rs3.Fields(0).Value = txtID.text
rs3.Fields(1).Value = txtName.Text
rs3.Fields(2).Value = txtAddress.Text
rs3.Fields(3).Value = List1.Text
rs3.Update
txtID = ""
txtName = ""
txtAddress = ""
List1.Clear
End Sub
2. this is the code for when i want to update any changes made to any record. clicking on adodc need to show the appropriate email attachments in List1 and should be cleared if that user has no attachments added. meanwhile, this doesn't seem to work.
Private Sub cmdModify_Click()
If …
i have a problem in trying to link my listbox with its respective field in the database. when i run my program in vb6, i get all the other records populated into my form when i click on the ADODC but i couldn't get the info i entered in my listbox displayed...and in my report in MSAccess, it only shows me only one item in the list instead of, say i added 3items!
any ideas on listbox with adodc?! :-|