Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




User Selecting Field From A File


I am trying to figure out how to allow a user to choose the file that is to be used, THEN choose which field in the file that is to be used.

I have successfully used the Drive, Directory, File List boxes and the user chooses the file. But, now my user wants to be able to see the fields (OR AT LEAST THE NAMES OF THE FIELDS) and then choose which one he wants to manipulate further.

What do I do, ANYONE???
THANKS.

 




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Selecting From A Field In A Database
As I am a bit of a novice to VB I need help with the following problem. I have a form to add new members to my membership table in a database. The form contains text boxes that write to the table via a command button. One of the text boxes is for 'Membership Number'. I want this text box to automatically come up with the next available number when I open the form. I'm sure that this is a fairly simple question, but I am new to the subject!

ADO, Selecting Field Names Dynamically
I'm trying to pull data out of a Table, but I need it to be variable on the selection of the field names. I've seen it done in DAO, but I need it done in ADO.

This isn't right.. but to give a example
VaryingString = "Field1"
adoRS_TableName!VaryingString = "hello "
VaryingString = "Field2"
adoRS_TableName!VaryingString = "there"
msgbox adoRS_TableName!Field1 & adoRS_TableName!Field2 'Message would be "hello there"

Thanks for the help.

Selecting On Base Of Merge Field.
Hi,

I've got a specific problem, maybe someone can help me...

I'm using BaanIV to make an ASCII .txt delimited mergefile. From BaanIV I also startup a blank document. From this document I want to generate a specific letter.
Which letter depends on some values of my .txt file-fields. For example: when my ASCII textfield "Letter" equals "firstletter"; Word document "Letter1.doc" has to be opend, when "Letter" equals "secondletter", Word document "Letter2.doc" has to be opend, etc. From this opened .doc I preform an automatic mailmerge with my ASCII file.
Finally here's the question: Within Word (in the VBE) I want to program a function in a Macro to check the value of the fileld from the .txt file, how can I do that ??

Regards,

Peter.

SELECTing Records From An Auto Int Field...
I have a field in my file that is type: int & identity field (not for replication).

When I try to run an SQL statement against the file to retreive a record that I know exists it hits EOF and does not return my record. I am converting a string "txtVendID.text" from a text field to do the search into an int by using the cint() function. However it still does not find a match. If I change the key field back to nVarChar everything works but I can't have an auto-incrementing key.

Here's how my SQL statement looks: (searching in an SQL 2000 database)

rs.Open "SELECT * FROM Vendors WHERE Vendor='" & CInt(txtVendID.Text) & "'", con, adOpenForwardOnly, adLockOptimistic


Can anyone see what I am doing wrong ???

Selecting Field Info From A DB Via Combobox
Hi,
So I'm trying to make a register-type programs that allows the selection of menu items from combo boxes. After a user changes a combo box selection I need the price for the newly selcted item to be displayed in a textbox. I have been trying to get this function to work by connecting to my DB through code (M$ Acces 97, jet 3.51, using ADO) but it is not working. Now I've been trying to select menu records by using a ADODC and linking the relevant textboxes to the ADO DC in order to see if the code Im using is even finding any menu item records...it isn't. I'm kinda at the end of my rope here, I've been trying anything and everything to try and get this working, can someone please point me in the right direction?

Code:Private Sub Combo1_Change()

With mcnConn
        .ConnectionTimeout = 25
        .Provider = "Microsoft.Jet.OLEDB.3.51" ' *** ACCESS
        .Properties("Data Source").Value = "C:Program FilesMicrosoft Visual StudioVB98Giacone.mdb"
        .Open
End With
Dim strSQL1, strSQL2, strSQL3, strSQL4 As String
Dim selection As String
Dim rs7 As New ADODB.Recordset
selection = Combo1.Value

'strSQL1 = "SELECT * FROM PizzaMenu WHERE Pizza LIKE '" & combobox1.Text & "%' "
'rs7.Open strSQL1, mcnConn, adOpenDynamic, adLockPessimistic, adCmdText
   
Adodc4.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=C:Program FilesMicrosoft Visual StudioVB98Giacone.mdb"
Adodc4.RecordSource = "SELECT Price FROM PizzaMenu WHERE Pizza =" & "'" & Combo1.Value & "'"
Adodc4.CommandType = adCmdText
Adodc4.CursorType = adOpenKeyset
Adodc4.LockType = adLockOptimistic
Adodc4.Refresh
 
    If rs7.State = adStateOpen Then
        rs7.Close 'Close the recordset
    End If
Set rs7 = Nothing

    ' **** Close Connection to DB if open ****
    If mcnConn.State = adStateOpen Then
        mcnConn.Close
    End If
    ' **** Clean connection object from memory ****
    Set mcnConn = Nothing

End Sub

Selecting Time Field In Query - Urgent
Hi All,

pls help me with this.

I am having a query in which one field is a datetime. I am using MS Access and VB 6. The data is stored as time in hh:mm format. Usually for a date field we enclose the value within ## (like#31/07/2006#). This does not work with time field. what is the syntax for time field?

Thanks in Advance!


Binish

Selecting A Field Based In Recordset Index
Say I have the following recordset:



ProfileName     RuleDesc      ProductName  (These are field names)

Soda            Open           Coke
Beer            Restricted     Corona


How could I reference the RuleDesc field for the record with soda as the profileName?

SQL Access - Selecting A Blank Date Field
IF a datefield can be blank, how do I select it?

Fields in job_scheduling
job_date = DATE
job_number = NUMBER Primary Key
job_time = DATE with format (hh:mm AM)

This works fine:

"INSERT INTO job_scheduling (job_number, job_date ) values (3,'11/16/2003');"

So now there is nothing for job_time on that day

SELECT *
FROM job_scheduling
WHERE (job_scheduling.job_number=3 AND job_scheduling.job_date=#11/16/2003# AND job_scheduling.start_time = ??? );

how do I select for job_time = Nothing? I tried 'Null' but it didn't work.


thanks,

Ram09

Selecting NT User
Does anyone have any code to do this?

Show the Domain servers in a combo (or ListView), to select the wanted one. Once you've selected the domain server, how to show all the users to select the user you want from the list.

User Browsing/Selecting A Exe
I would like the user to (click a button or whatever) and have a browse window come up asking them to select a file(usually a exe) then, it returns the filepath/exename. Thanks,
___
dan

User-selecting Folder
I want the user to be able to select a folder which then the program sets a variable to.

In some installation programs it looks like a control that is a tree and u just open and close the folder. The selected folder is where you install it. Does anybody know what this control is called?

Thanks

Selecting Values In A DataCombo Linked To A Calculated Field In The Recordset
Hi all,

Please help me with this one:

When I try to choose an entry in a DataCombo I get the following message: "Field not updatable, Bound Property Name: boundText, FieldName: UserName"

These are the commands that fill the DataCombo:

strcriteria = "SELECT Officers_Functional.Worker_Number, [General_Users].[First_Name] & chr$(32) & [General_Users].[Middle_Name] & chr$(32) & [General_Users].[Family_Name] AS UserName FROM General_Users INNER JOIN Officers_Functional ON General_Users.Worker_Number = Officers_Functional.Worker_Number WHERE (((Officers_Functional.Ordinal_Projects)=" & iProject & "))"

rsUsers.Open strcriteria, adoConn, 1, 3

With DCmbCurrentOwner
Set .DataSource = rsUsers
Set .RowSource = rsUsers
.ListField = "UserName"
.DataField = "UserName"
.BoundColumn = "Worker_Number"
.BoundText = ""
End With

As you see, the field UserName is a "calculated" field.
Other DataCombos in the program that are filled without "calculated" fields, work fine.

What is the reason for this annoying message and how can it be avoided?

Selecting Values In A DataCombo Connected To A Calculated Field In The Recordset
Hi all,

Please help me with this one:

When I try to choose an entry in a DataCombo I get the following message: "Field not updatable, Bound Property Name: boundText, FieldName: UserName"

These are the commands that fill the DataCombo:
strcriteria = "SELECT Officers_Functional.Worker_Number, [General_Users].[First_Name] & chr$(32) & [General_Users].[Middle_Name] & chr$(32) & [General_Users].[Family_Name] AS UserName FROM General_Users INNER JOIN Officers_Functional ON General_Users.Worker_Number = Officers_Functional.Worker_Number WHERE (((Officers_Functional.Ordinal_Projects)=" & iProject & "))"
rsUsers.Open strcriteria, adoConn, 1, 3
With DCmbCurrentOwner
Set .DataSource = rsUsers
Set .RowSource = rsUsers
.ListField = "UserName"
.DataField = "UserName"
.BoundColumn = "Worker_Number"
.BoundText = ""
End With

As you see, the field UserName is a "calculated" field.
Other DataCombos in the program that are filled without "calculated" fields, work fine.

What is the reason for this annoying message and how can it be avoided?

Preventing User From Selecting Textbox
I know that I can prevent a user from editing the contents of a Text box control or RichTextBox Control by setting the Locked Property to true; but how can I prevent the user even from inserting the cursor into the box?

I really appreciate any guidance I can get.

Selecting An Outlook User Profile
Hello World!

How can I programmaticaly select, a specific user profile when opening Outlook with automation, if the user has more than one?


Selecting Row Of Datagrid Without User Input
OK, hopefully a real easy question:
I am making an app that has no keyboard or mouse, only a touch screen. On the form is a datagrid that the user is to select the correct row using buttons (labelled Up, Down). I need to have the row selection change with the press of the button, either up or down. I am currently using a datagrid because it is very lightweight. The datagrid control only gives these methods:

selstart, selcolstart, selcolend, row, col

when either button is pressed, I need that specific row to be selected and change color (obviously).

How can I get this done??? I have tried many variations but am still stumped.

Display User Form When Selecting A Sheet
Hi, i want to display a user form when i select a sheet, at the moment i'm usind the right_click event, just like this:

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
UserForm2.Show
End Sub


But i would prefer to display the userform when selecting the sheet.

thank you for your time ;-)

pacho

Need To Export SQL Data To XML File. 1 Field Is A BLOB (binary Field)
I'm a VB/SQL newb looking for some help on exporting records from the DB to an XML file. one of the challenges is that i have one field that is a Binary datatype (BOLB). i need to export that data out and convert it from its Binary state to readable text and save it to an XML file. Can some help me with this?


i will need to be able to specify how the XML file is laid so i can designate the tag names to be compatible with my web software.

Sample code, small projects...anything would be great.

Thanks
GK

Logging Field Changes By A User
Hi guys,

I need to log each change made to a field by a user. Fields such as Firstname,ID Number and so forth.

What would be the easiest way to accomplish this. I was thinking of having two UDT's. In the first UDT I would store all the information on the form load. In the second UDT I would store the information once the user clicks save, and the I would compare the corresponding values of both UDT's and log the changed ones.

Am I on the right track here. I'd love to get your opinions.

Regards,
Nitesh

Retaining User Until A Table's Particular Field Changes
Is it possible, using VB code, to retain a user on a particular page until the status of a certain field in a database is changed?
The scenario I am working on is that a person makes a reservation and has to wait until that reservation has been accepted or rejected by the administration.

Dim dsResv As DataSet
dsResv = objResv.DALgetResvStatus(resvId)

While (dsResv.Tables(0).Rows(0).Item("resvStatus") = "pending")

dsResv = objResv.DALgetResvStatus(resvId)

If dsResv.Tables(0).Rows(0).Item("resvStatus") = "denied" Then
failure.Visible = True
LinkButton1.Visible = True
ElseIf dsResv.Tables(0).Rows(0).Item("resvStatus") = "reserved" Then
success.Visible = True
LinkButton1.Visible = True
End If

End While

This is how I tried to do it, but it doesnt seem to work.
Any suggestions?

Check Text Field And Allow User Input
I have a very annoying issue with a program that I’m writing. The interface has two input fields: part number and revision. A user is supposed to type in a part number and a revision and then click on Search command. First the program is checking to see if there is any text in the part number field; it the field is empty, the program is displaying an error message and it should go back and allow the user to type in the part number. Then it should do the same thing with the revision field. In my case if the part number field is blanc, after the error message the program continues with the revision field check and then goes through the entire program even though the searching fields are empty. Can anyone shed some light please? This is part of the code:

Code:
Private Sub cmdSearch_Click()

Call Check_Part_Number
Call Check_Rev

PartNumber = UCase(Trim$(txtPartId.Text))
PartRev = UCase(Trim$(txtRev.Text))

End Sub


Code:
Private Sub Check_Part_Number()
If Len(txtPartId) = 0 Then
MsgBox "This field can not be blanc!" & Chr(13) & _
"Please type in the Part Number.", vbCritical
Else
Exit Sub
End If
End Sub


Code:
Private Sub Check_Rev()
If Len(txtRev) = 0 Then
MsgBox "This field can not be blanc!" & Chr(13) & _
"Please type in the Revision.", vbCritical
Else
Exit Sub
End If
End Sub
Thanks,
poli

Grid Control, How Can A User Write In A Field?
Hi there
First sorry about my englisch.
And now, i have a question. I have to set up a grid control where the users of my application must can write to the fields. I know how i can select a certain field but i dont know how i can make it writeable for the user. Can someone help me pleas? or is this impossible with the normal grid control?

thanks for your fast answers

Greethings from Switzerland

How Can A User Enter A Crlf In A Control Text Field
Hi,

Is there a way a user can enter a vbcrlf in a control to embed a crlf in a controls .text field?

Regards,
Phil.

Excel - Selecting A File Using Windows File Open Window
Hi,

I am working in an Excel Sheet(Say from Excelfile1.xls ). How should I select another Excel file(say from Excelfile2.xls) from someother folder in my machine? Can the Windows 'File Open' Window(or File Chooser window) can be displayed on click of a button in an Excel Sheet? If yes, How?

Thanks in advance,
Nikhil

 

Edited by - kulksnikhil on 5/3/2003 3:47:09 AM

Macro Problem In Outlook(How Do I Sort A User Defined Field?)
We have a repairs database, in Public Folders (on Exchange 2003) which we
generate RMA's from (Return Materials Authorisation) when people need to
return a faulty product.

We use a custom contact form, and one of the user defined fields is called
RMA.

I have a macro that people can use to create a new RMA which will populate
the new RMA with data from a previously selected one to save typing in
company name, address, phone and so on. It also grabs the most recent RMA
number adds 1 to it and fills that into the new RMA as well.

This all works well as long as people either create a new contact or use the
macro.

The problem arises when somebody does a copy and paste of a pre existing RMA
and manually changes the RMA number to the next higher one. When the macro
is run after that, it doesn't recognise that this is the newest RMA and will
generate a new number based on the newest one that was made without using
copy and paste.

Presumably this has something to do with the default way that Exchange
stores new contacts in a folder, with copy and paste perhaps pasting the
duplicate information so that the contact does not appear to be new. I don't
know so I'm clutching at straws here.

I'm trying to work around the problem by finding some way to sort the RMA
field and find the highest number, but I'm unsure of how to go about this.

I have tried "Sort", but that doesn't work with custom fields.

Any pointers would be greatly appreciated.

Regards,
Jim

Code Below here:

Code:
Sub NewRMA()
Dim objContactsFolder, MyFolder1, MyFolder2, MyFolder3 As Outlook.MAPIFolder
Dim objContacts As Outlook.Items
Dim objContactsNew As Outlook.Items
Dim objContact, myItem As Object
Dim objSel As Selection
Dim CompanyNew, AddressNew, PhNew, FaxNew, PCDateYear, NewRMAYear As String
Dim objProp, objRMA As UserProperty
Dim myOlApp As Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim RMANo


' Specify which contact folder to work with
Set objContactsFolder = Outlook.ActiveExplorer.CurrentFolder
Set objContacts = objContactsFolder.Items
Set objSel = Outlook.ActiveExplorer.Selection

' Read the data
For Each objContact In objSel
If TypeName(objContact) = "ContactItem" Then
CompanyNew = objContact.CompanyName
AddressNew = objContact.BusinessAddress
PhNew = objContact.BusinessTelephoneNumber
FaxNew = objContact.BusinessFaxNumber
PCDateYear = Right(Date, 2)
End If
Next


'Compile New RMA from using existing contact info
For Each objContact In objContactsFolder.Items
If TypeName(objContact) = "ContactItem" Then
If objContactsFolder = "Repairs" Then
Set objRMA = objContact.UserProperties("RMA")
NewRMAYear = Right(objRMA, 2)
If NewRMAYear = PCDateYear Then
RMANo = Left(objRMA, 3) + 1 & "/" & PCDateYear
Set objRMA = Nothing
End If
Set objContact = objContactsFolder.Items.Add
objContact.CompanyName = CompanyNew
objContact.BusinessAddress = AddressNew
objContact.BusinessTelephoneNumber = PhNew
objContact.UserProperties("RMA") = RMANo
objContact.UserProperties("RepairStatus") = "Awaiting Arrival"
objContact.UserProperties("LastActioned") = Date
objContact.BusinessFaxNumber = FaxNew
objContact.Display
End If
End If
Exit For
Next


'Compile New RMA
If objContactsFolder <> "Repairs" Then
Set myOlApp = New Outlook.Application
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set MyFolder1 = myNameSpace.Folders("Public Folders")
Set MyFolder2 = MyFolder1.Folders("All Public Folders")
Set MyFolder3 = MyFolder2.Folders("Repairs")
Set objContactsNew = MyFolder3.Items
For Each objContact In MyFolder3.Items
Set objRMA = objContact.UserProperties("RMA")
PCDateYear = Right(Date, 2)
NewRMAYear = Right(objRMA, 2)
If NewRMAYear = PCDateYear Then
RMANo = Left(objRMA, 3) + 1 & "/" & PCDateYear
Set objRMA = Nothing
End If
Set objContact = MyFolder3.Items.Add
objContact.UserProperties("RMA") = RMANo
objContact.UserProperties("RepairStatus") = "Awaiting Arrival"
objContact.UserProperties("LastActioned") = Date
objContact.Display
Exit For
Next
End If

' Clean up
Set objContact = Nothing
Set objContacts = Nothing
Set objContactsFolder = Nothing
Set myOlApp = Nothing
Set myNameSpace = Nothing
Set MyFolder1 = Nothing
Set MyFolder2 = Nothing
Set MyFolder3 = Nothing
Set objContactsNew = Nothing
Set PCDateYear = Nothing
Set RMANo = Nothing

End Sub

Re: [Updated] If User Tab Keystroke In Protected Word Form Field, Then Go To...
I'm working with Word form fields (not a user form), and want to control where the insertion point moves to when the user presses the Tab key to exit the form field.

I've done the code that says when you exit a given form field go to another specified form field (see below).
However, I cannot figure out how to make execution of this conditional. I want to run it ONLY if the user presses the Tab key to exit the form field. That is, if the user clicks the mouse or uses Shift+Tab to exit the field, it needs to act "normal." That is, NOT jump to the specified next form field, but rather go to where the user clicked or to the previous field on a Shift+Tab.

When working in a Word doc, how do you determine if a user pressed the Tab key, then execute if they did?
Would much appreciate any help with this!

How I'm controlling movement through the form fields:
Code:If Selection.FormFields.Count = 1 Then
     'if field is not a textbox but a check- or listbox, capture that name
     MyFFName = Selection.FormFields(1).Name
'if selection is a text field, capture that name
ElseIf Selection.FormFields.Count = 0 And Selection.Bookmarks.Count > 0 Then
     'add whatever the bookmark name is, to the designated variable
     MyFFName = Selection.Bookmarks(Selection.Bookmarks.Count).Name
End If

Select Case MyFFName
    Case "S1_1_Txt"
        Selection.GoTo What:=wdGoToBookmark, Name:="S1_1_Priority"
    Case "S1_1_Priority"
        Selection.GoTo What:=wdGoToBookmark, Name:="S1_1_Rate"
    Case "S1_1_Rate"
        Selection.GoTo What:=wdGoToBookmark, Name:="S1_2_Txt"



Edited by - topaz2 on 1/20/2007 5:18:10 PM

Creating Database By Taking Input Field Values From User
my query is regarding

i want to create database by using front end VB6.0 n
in this application user should enter input for the field of the database table where,
 there is already one data.mdb file which is used to create DSN named as data.

plz help me out on this problem
regards frnd vani..

Default To File Selecting In Open File Dialog Box
I want to default my program to select a default databse in the Set Component and sub-assembly library. This means is to assure that the other database are not opened by mistake. i want it to defaultly select Generic Library.mdb. i am fairly new to vb so any help is greatly appreicated... thanks in advance


Private Sub ConfigSetDefComSubLib_Click()
On Error GoTo Fokop
CD.DialogTitle = "Set component and sub-assembly library..."
CD.Filter = "MS Access Database Files (*.mdb)|*.mdb|All Files (*.*)|*.*"
CD.ShowOpen
temp = CD.FileName

If temp = "" Then Exit Sub

GlobalVar.SubComDBName = temp
Call DBOps.SetComSubLib
LoadCompTree Combo2.Text
CurrCompLabel.Caption = Combo2.Text
Call LoadSubTree(Combo3.Text)
Call DBOps.LoadACompTree
Call CompTV2Grid
Label3.Caption = temp
Label4.Caption = temp
Exit Sub
Fokop:
GlobalVar.SubComDBName = ""
StatusBar1.Panels(2).Text = "Operation could not be performed."

End Sub

Validate User Input Format For Social Security Number Field
Hello,

I have a program that users can search and add to a database by Social Security number. The problem is that if someone enters in a Social Security number in the wrong format (i.e. 123-456-789), it takes it. Obviously I only want it to be able to take the correct format: 123-45-6789.

How would I be able to validate that the user inputs the Social Security number in the textbox correctly?

Thanks in advance for any help that is provided!

Add A User To User-Level Security Workgroup File
I have a program that works with an Access database protected by User-Level Security. I can open, work with and close the database. Now I'd like to be able to add or remove users from the Workgroup file (.mdw). Is there an easy way using VB6 code? I can do it from within Access but want it to be done from my program.

Thanks!
Chuck

Excel File Locked By User: How Do I Get User ?
Hi,

I have an Excel file that will be opened by users over a network using a vb fronend. I have a check in place to see if the file is opened and then display a message.

How can I tell which user has the file open?

Really need some urgent help on this.

Thanx in advance

gottcha

Verifying Fixed File Field Format With Database Field Format
I am creating a fixed file data upload tool. Data will be uploaded to a MS SQL 2000. Can someone show me the scripts to validate fixed file field format with Database field format?

Heres a possible situation:

The source file will be fixed length. So lets say the first row will contain fields name ID(10), NAME(20), EMAIL(80) and ADDRESS(100).

And the table CUSTOMER, SHOULD have the four following fields with same name as well. But sometime it is not the case pending which table or which source file selected. Therefore I need a script that will check the 1st row fields from the source file agaisnt the Database table field selected. Before a function to upload can be executed.

Can someone show me how to write the script...THANK YOU.











Selecting A File
I want a user to be able select an access database file to open. What is the best way to do this. I am currently using a static connection :

Set cnConnection = New ADODB.Connection
cnConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=C:DataWireline.mdb;Persist Security Info=False"

Thanks in advance.....

Selecting A File ..
i have this code for time being ..

VB Code:
FF = FreeFileBlockEnd = 1BLockStart = 1Open App.Path & "Test.txt" For Input As #FF    Txt = Input(LOF(FF), FF)    'Read the whole fileClose #FF


Which is opening a file from same path for further processing , i want to give user an option to select any file for that i have put a drivelistbox , dirlistbox and file listbox and i have linked drive with dir ( now i am able to get all the files displayed in my filelistbox ) what code should i give in place of above given code that ... selected file at runtime from filelistbox ... gets in place of FF

Regards

Selecting A File
ok i want to be able to click a command button and browse my computer for a picture file to be loaded in a picture box anyone know how to do this??

Selecting A File
I am trying to select a file using a directory list box or some other control and place the path and name of the file in a text box. Any suggestions?

Selecting A File
Hi,

How can I provide a option to select a file....something like browse button provided by HTML.

I have refered to

http://www.codeguru.com/forum/showt...threadid=205597

but that stops at selecting a folder.

Nitin

Selecting More Than One File
Thanks in advance!!

Does anyone know how to set the ShowOpen dialog from the common dialog so that more than one file can be selected.

Thanks Greg

Selecting File Types
l have created a program but l am one bit short of having it perfect and l have no idea whatsoever of how to do it. Basically, l have a list of files that at the moment just shows all files. What l want is a text box so that l can just type in what file type l would like and it shows it in the list box. Please find attached the code. I have added the text box already. If you could help me l would be most grateful because this is driving me mad and l know its just something so simple!!

Thanks.

Selecting A File From A Folder (name Changes)
Hello,

Right, i think i may need some help!

Each web page is made up by a collection of objects, such as .gif images. These objects are stored in the 'temporary internet folder'.

What i would like to do is select a .gif image from this folder. (easy)

BUT.......... i wouldnt know the exact name of the .gif file. The only thing that that makes it (potentially) unique from all the other .gif files in the folder is 2 things.

Firstly, the image i want always starts off with the letter "X" and secondly, it will always have "10W500H300" at the end of the file name.

I need to select this image from this folder and then display it in a picture box. When it is displayed i can then save it to whatever filename i want.

The 'original' file (in the tempory internet folder) would then have to be deleted.

I figured i will have to use the Instr function but i am not too sure how. Also how would i go about deleting this file when i am finished?

Aprreciate any help given

Thanks

Selecting File Data
cboTreatments-(holds treatment and price)
User can select up to 4 treatments and prices.
How can I code so that when the first treatment & price are selected they only populate the 1st lbltreatment and txtprice and then allow me to select a 2nd treatment which populates the 2nd lbltreatment & txtprice etc. Here my code so far.

Private Sub cboTreatment_Click()
Dim TreatmanetDetails As String
TreatmentDetails = cboTreatment.Text

lblTreat1 = Left(TreatmentDetails, 40)
txtCost1 = Right(TreatmentDetails, 6)

lblTreat2 = Left(TreatmentDetails, 40)
txtCost2 = Right(TreatmentDetails, 6)

lblTreat3 = Left(TreatmentDetails, 40)
txtCost3 = Right(TreatmentDetails, 6)

lblTreat4 = Left(TreatmentDetails, 40)
txtCost4 = Right(TreatmentDetails, 6)


txtGross.Text = Val(txtCost1) + (txtCost2) + (txtCost3) + (txtCost4)

End Sub
Thanks in anticipation
Rosi

Selecting File Info
Hi
How can I select the relevant record info from a cbofile to go into txt boxes. When I highlight and click on the info I want it doesn't display that record. The record displayed in the txt boxes is always the last record in the file. My code just needs tweaked a bit. Can anyone help?

Rosi

Selecting File Output Name
Hi,

I have the following code that allows a user to select a file and then select the destination of where the new file will be stored.

Code:
Private Sub Command1_Click()
  ' Ask for input filename using the commondialog
  With CommonDialog1
    .DialogTitle = "Select the INPUT file"
    .Filter = "Text (*.txt)/*.txt" ' for opening only text files
    .ShowOpen ' shows the dialog box asking for the input file
    strInputFile = .filename
  End With
  
  Label1 = strInputFile 'Display the INPUT file destination

  ' Ask for output filename using the commondialog
  With CommonDialog1
    .DialogTitle = "Provide the OUTPUT file"
    .Filter = "Text (*.txt)/*.txt" ' for opening only text files
    .ShowSave ' shows the dialog box asking for a folder and a filename to save the output in
    strOutputFile = .filename
  End With
  
  Label3 = strOutputFile 'Display the OUTPUT file destination
  
End Sub


How would you make it so that strOutput is automatically set to:
strInput with '_gamma' attached to the end

for example if strInput is RN0893845.txt I want strOutput to be automatically be set to RN0893845_gamma.txt



Edited by - artrite on 6/28/2005 11:00:23 PM

Need Help Selecting A Line From A Text File
i need help to select a specific line from a text file.

the text file is like this:

"Text1", "Text2", "Text3", "Text4"
"Text5", "Text6", "Text7", "Text8"
"Text9", "Text10", "Text11", "Text12"

basically i have a listbox, which will have Text1, Text5 and Text9 in it.

For Example If I click on Text1 in the list box, i want the text file to open up and then load Text2 into a text box, text3 into another text box and text4 into another textbox.

if i click on text5 then i want that line loaded into the text box's

and so on..

Selecting A Range In A Parsed Txt File
I'm importing a txt file into an Access DB. Problem is the date format keeps changing on the txt file that is being imported. How can I select a certain part of a record as see below.

this is f1 of the imported text file
Tournament started 2004/01/26 @ 02:04:43 (CST) -- Game #426

This is the code I am currently using
Set sele1 = CurrentDb.OpenRecordset("SELECT [f1] & [f2] & [f3] & [f4] AS Item, DateValue(Mid([f1],21,8)) AS Dte, TimeValue(Mid([f1],26,8)) AS Tme, Right([f1] & [f2] & [f3] & [f4],9) AS Gme, Num FROM ImpData WHERE ((([f1] & [f2] & [f3] & [f4]) Like " & """Tournament s*""" & " Or ([f1] & [f2] & [f3] & [f4]) Like " & """Tournament F*""" & ") and Num = " & I & ");")

The problem is the txt file will be short date mm/dd or like it is above yyyy/mm/dd. What is the correct coding for selecting all text between after the word "start" and before the symbol "@".

Thanks for any help
jtm

Selecting A Folder To Save A File
Hi,

At the moment i am searching for a way to let the user of a program select in what folder he saves the generated documents.
I've made a form on wich i can choose a drive letter and a folder. I open the form, but of course the rest of te program keeps on running (so the file will be saved in the default folder)

is there any way i can delay the rest of the actions until there's a folder chosen?

thx

Selecting And Viewing File In Different Forms
Hello,
I have done some research after the follow problem but didn't find a thing about it:

When selecting an excelfile (in a filelistbox) that file has to be read in that same form, but also in another one. It's no problem to view the file in the opend form (using MSHFlexgrid), but when I open another form (with a button on the first form) I need to see the selected file there to, also in MSHFlexgrid.
Can someone help me here, I don't think that its difficult but I simply can't find it.


Greetings
G100

Automating Selecting A File From The Filelistbox
Hello,

I am creating a program that is going to batch zips 20,000 images. Each image contains three files a .sid, .sdw and .aux. I want to create a zip file for each instance of those three files, image1.sid, image1.sdw, image1.aux > compressed to image1.zip, then image2.sid .sdw .sdw ...etc

I have the compression part of the solution already created and tested.

My problem is with the reading the actual file names from the FileListBox. It works when I have selected a file manually in the FileListBox.

I can already cycle through the filelistbox, using the code below. But I need to figure out a way to simulate selecting a file from the filelistbox?

Any ideas?

Thanks,

Glenn


Code:
Private Sub cmdRecurse_Click()

Dim fpath, fname As String
Dim x As Integer

fpath = BrowseForFolder(App.Path, Me.hwnd, "&Select a directory:")
' this used the SHBrowseForFolder API function

FileDsp.Path = fpath

For x = 0 To FileDsp.ListCount - 1

MsgBox (FileDsp.List(FileDsp.ListIndex))
' returns ""
' when I have selected a file it returns the filename.

fname = filedsp.filename
' returns ""
' when I have selected a file it returns the filename.

Next x
End Sub

Auto Selecting A File In A FileListBox
strange, tested u'r sample, and it works just fine.

maybe add some doevents up front, or move the code to the Form_Activate event?

Copyright © 2005-08 www.BigResource.com, All rights reserved