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




FlexGrid Editing With Combobox In VBA


hello all,

I am new to this Forum.

Here is my Problem....

I need to Edit the FlexGrid (on the UserForm) With Combobox (For Limiting access to Edit) in VBA...

I had done this thing in VB6. It is working Fine. But the Same Code was Not Working In VBA.....

Editing With TextBox was Going Smooth in both VB and VBA...

please any one help...


Thanks in Advance...
Sudhakar




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Need Help Editing FlexGrid
I have the "Visual Basic 6.0 Black Book" and it has an example about how to create a spreadsheet type control. Here is the code:


Code:
Private Sub msfgPS_Click()
txtmsfgChange.Text = txtmsfgChange.Text & Chr(KeyAscii)
txtmsfgChange.SelStart = 1

txtmsfgChange.Move msfgPS.CellLeft + msfgPS.Left, msfgPS.CellTop + msfgPS.Top, _
msfgPS.CellWidth, msfgPS.CellHeight

txtmsfgChange.Visible = True
txtmsfgChange.SetFocus
End Sub
Private Sub msfgPS_LeaveCell()
If txtmsfgChange.Visible = False Then
Exit Sub
End If

msfgPS.Text = txtmsfgChange
txtmsfgChange.Visible = False
txtmsfgChange.Text = ""
End Sub


The problem is that the textbox never becomes visible. I can't see the blinking cursor and the text from the flexgrid cell clicked upon doesn't get transfered to the textbox. It probably is but since I can't see the damn thing, I don't know. Anyone know why the textbox "txtmsfgChange" isn't becoming visible? Thanks, Jeremy

How To Put Textboxes For Editing In MS Flexgrid In Vb6
hi
i'm working in vb6.
i have a problem.i know editing is impossible in Ms Flexgdird at run time but i have to put this property in my project .what i have to do .imagin ,i have to add textboxes in each cells then the problem is that how much textboxes i can put.its too hectic to do this becoz user can insert too many rows in the grid ,i even cannot fix user to insert only fixed number of rows. then what i have to do.actually i don't know how much rows user can enter ,it may only one or two or 50.

thankx
madhu

How To Put Textboxes For Editing In MS Flexgrid In Vb6
hi
i'm working in vb6.
i have a problem.i know editing is impossible in Ms Flexgdird at run time but i have to put this property in my project .what i have to do .imagin ,i have to add textboxes in each cells then the problem is that how much textboxes i can put.its too hectic to do this becoz user can insert too many rows in the grid ,i even cannot fix user to insert only fixed number of rows. then what i have to do.actually i don't know how much rows user can enter ,it may only one or two or 50.

thankx
madhu

How To Put Textboxes For Editing In MS Flexgrid In Vb6
hi
i'm working in vb6.
i have a problem.i know editing is impossible in Ms Flexgdird at run time but i have to put this property in my project .what i have to do .imagin ,i have to add textboxes in each cells then the problem is that how much textboxes i can put.its too hectic to do this becoz user can insert too many rows in the grid ,i even cannot fix user to insert only fixed number of rows. then what i have to do.actually i don't know how much rows user can enter ,it may only one or two or 50.

thankx
madhu

Editing && Saving Data From The FlexGrid
Hi ALL

i have to enter data in a grid (i,e the grid must be editable). I have chosen FlexGrid for the same. Now, the changes the user makes on the grid must be saved to the access database, which I am unable to do ?

I am using ADO to connect to the Database. Can anyone help me with the code for doing the same ??

THANX

plz help me

Locking Columns For Editing In FlexGrid
Hi..

I am using MSFlexGrid for data entry .I would like to have locking feature
as it is available for textbox control..Is it possible to lock certain
columns of Grid for editing...?

BHARAT P JAIN

ComboBox's And Editing
Is there any way to stop people from editing what options there are in a combo-box? at the moment, it displays 4 options, but the user can type their own text into the form, which would not allow it to work correctly, I desperatly need a cure for this, as its really getting on my nerves
Thanks

User Editing Combobox....
Hail all!

I have a combobox with 5 itens... Its works fine... They are selected very well... but theres is something that I dont know how to prevent... For example... everytime that the user selects an item, a cursor appears and he is able to "delete" the word or select the world and change something on the item...

I tryed the lock property, but when I put it true... I cant select any item from the combo...

I would like to have my combobox working as a combo of an webpage.. That one you cant edit the options you just can select the item, without edit it...

Og by the way, when I say delete and edit, is just in the moment that he do it, if you select the combo again.. you will see the word that was edited or deleted again, normally without the edition, as it would be. Its just annoying see the word selected in a combo box... Anyone know how to select the item... and not just the word?

Thx for your time,

Elminster

No Editing To Combobox Text
I want to lock the combobox from changes to the text but still let the user select items from the cbobox. How would I do that? I need something like this : cbobox.text.lock=true which is not available. If I set lock=true, the user can't select anything. Thanks.

A Simple Question About Combobox Editing
when I edit a given entry in a combobox, it doesn't change the selected element, but adds an additional one at the end. I think I'm missing something very simple.

Thanks

Stop ComboBox Text Editing
How can I make it where the contents of a ComboBox aren't editable? Thanks, Jeremy

Using Combobox In Flexgrid
Hi,

Who would like to tell me how to use combobox in flexgrid control.
I want the combo box displayed on the cell when one cell in the grid is clicked. Then the combox texts can be selected.


Thanks

James

FlexGrid And Combobox With Excel
Hello all.
I am trying to add some features to a program I am writing, so hopefully you guys can help out. I have absolutely no experience with excel via VB6, but need it for my program. I need to use the excel data to be used both in a combobox and FlexGrid control. What I am trying to do is as follows:

The number of columns will be the number of lists I need, with the title of the list in the first row. These names will need to be added to a combobox. When I click on one of these names in the combobox, I need the rest of that column to appear in the first column of the FlexGrid. The second column of the FlexGrid needs to contain column 1's data with the words "row2".

Here is an example of what it would look like:

Excelfile.xls

LISTA LISTB LISTC LISTD
a1b1c1d1
a2b2c2d2
a3b3c3d3
a4b4c4d4
a5b5c5d6
a6b6c5d6


Run the program

Combobox contains:
LISTA
LISTB
LISTC
LISTD

Click on LISTA and a1, a2, a3, a4, a5, and a6 get put into column 1 of the FlexGrid.
alrow2, a2row2, a3row2, a4row2, a5row2, and a6row2 would be put into the second column of the FlexGrid.

The FlexGrid would be cleared when clicking a new list and the new data would come up into the FlexGrid.

It looks like a pointless program, but I will be able to figure out how to implement these things into my code. Thanks so much in advance for the help.

-koskilla

Edit Flexgrid With Combobox In VBA
hello all,

i am new to this Forum.
please help me.

i need to edit the FlexGrid with Combobox...
i can do it in VB6.. Its working fine..

But its not working in VBA ....

Can Any one help me to overcome this thing...

thanks in advance...
Sudhakar

ComboBox In Flexgrid < Resolved >
Hello All memebers
How can i insert ComboBox In a certain column of the msflexgrid?
Thanks Alot for advice


Egyptian Man

Edited by - tom77757 on 6/16/2004 2:48:16 PM

Edit Flexgrid With Combobox In Vba
hello all,

i am new to this Forum.
please help me.

i need to edit the FlexGrid with Combobox...
i can do it in VB6.. Its working fine..

But its not working in VBA ....

Can Any one help me to overcome this thing...

thanks in advance...
Sudhakar

FlexGrid Select Case And ComboBox
Hi

I have Editable FlexGrid with 4 Col's & 4 Row's and 1 Combo for each Col

First Col on FlexGrid with comb1 placed on it with AddItem "YES" And "NO"

In any row if i choose "NO" then Combo2 & 3 and 4 can't be Editable for the selected Row only

Search With 3 Combobox In A Datagrid Or Flexgrid
Hi everyones..

I really need some help about this topic..
I have a 3 combobox controls and a datagrid control, in these controls a need to put a search results from a table.
Are 3 combobox and i would like that begin to searh inmediately the datagrid update the results in the type each key (upper leter)

Tks for any help..

regards

How To : Copy Data From Combobox - FLexGrid And Count The Matches
I have an MSFlexGrid on my form that I want to fill with data. Its a long story but the user selects data from a combo box and the chosen data is entered into the MSFLexGrid. The grid has just 2 columns in it. What I need to do is this :

Grid Layout
___________________________________________
| 2 | Bobby |
| 1 | David |
| 4 | Jason |
| 2 | John |
-------------------------------------------------

- The user's selected data is copied from the combo box drop down list to the second column within the flex grid (name).
- If the grid already contains an exact match for the user's chosen data then the 1st column of the grid next to the matching data is to count UP by one and display an integer indicating how many times that same data has been inputted into the grid.


Honestly, I have no code at this point that even comes close to unravelling this mystery, so I can't share with you my struggle. To be quite frank about it, I have no idea how to even start something of this nature. Flex Grids are completely foreign to me. I've read through several different FlexGrid tutorials and am affraid that I am more confused than ever.

Peculiar Behavior Flexgrid Similar To Martin's Editable Flexgrid (Solved)
Hello guys! Long time no see... I have been very busy so I wasn't able to come on before.

I tried browsing the forum for an answer to this problem I found out. This bug occured when I was coding an editable flexgrid which is similar to the one Martin posted in the CodeBank and it is a particular one.

I will attach the project so you all can see what I mean. The problem seems to happen when you have a column which width is greater than the flexgrid's width.

When you click on that cell the TextBox is located on the place of the cell but since the width is greater than the flexgrid's then it covers the whole control and surpases it.

How can I avoid this to happen? I mean, I thought I could do something as checking the position and the width to see if it surpases the control's width limit... But if I did that and the grid has its scrollbar then I would need to know the width of the scrollbar to substract it and I am afraid I don't know how to do that.

Any suggestions or a workaround?

Thanks in advance!

Superimposing Textbox And Listbox In A Flexgrid To Enter Values In Flexgrid
Hi,
    I had done a project(VB6) where I placed a textbox in flexgrid to enter data in flexgrid.After that I tried using textbox and listbox to enter data.When i press a key(FlexGridKeyPress Event) the textbox is made visisble in the current cell of flexgrid.the listbox is filled with values, so that when i enter data in textbox,listbox will be made visisble just below textbox appearing as if it is a combobox and depending on the values i enter in textbox the listbox scrolls up (if there is matching text entered in textbox) and by using arrow keys(keyboard) (event :- txtKeyDown event, kCode:-keycode=35)
i should be able select a value from listbox and the selected value(if selected) should be
displayed in the textbox.After that on enter key press (Keyascii=13) the textbox and
listbox should be made invisible(visible=false) and either the selected value from listbox or any text I enter in textbox should be displayed in the current cell of FlexGrid and after that focus should goto next cell same row in the flexgrid.I was able to bring the text box and listbox in the proper places but could not do the rest.Please can u give me
the solution with source code




Edited by - sanththomas on 7/7/2002 6:49:21 PM

Autosize Rows In Flexgrid && Loop Through Flexgrid
How to autosize the rows and column in flexgrid?
Mr Flyguy in your tutorial I have tried it but how to call the function

FG_autosizerow(dbgrid) --> i Have tried this but it wont work

How to make my first column of flexgrid enable true and the other column false enable

eg:

1 2
aa ww
aa ww
aa ww
I want the 1st column being enable and the 2nd column false enabled

How to achieve this

Thx

Printing Title, FlexGrid, Body, FlexGrid
Good evening, let me explain my dilemma:

I was asked for two tables that would be populated with a SQL statement, the second table would get filled based on the row selected on the first table. This is already done and adding, deleting, updating... Everything I was asked. But both of these two tables have a column of "description" that can be a very long one... My problem here is that I was asked to print a title, then the selected row of the first Table, then a comment and finally the second Table.

The thing is that I don't know how to print it like that... My first solution was to build a form (frmPrint) with two labels (the title and the comment) and two tables... Then use frmPrint.PrintForm and that was it.

There was an inconvenient of using that method and was the lenght of the description field... So I searched through the forums for a way to print a FlexGrid and I found Hack's code... But I realized that if I used it, it would print just in one page the first table and in a second page the second table...

Here is his code:


VB Code:
Private Sub PrintGrid(mfgGiven As MSFlexGrid)Dim OldWidth As Integer OldWidth = mfgGiven.WidthmfgGiven.Width = Printer.WidthPrinter.PaintPicture mfgGiven.Picture, 0, 0Printer.EndDocmfgGiven.Width = OldWidthEnd Sub


I was thinking that maybe I should add parameters to print in a given Y so that I could print it as I stated it before... But, how can I calculate the Height of the whole FlexGrid (The first one)?

I also thought I could call word (invisible), set the data there in a tables and then print... But I wouldn't like to bound my application to the use of Word...

Thanks for your time!

Combobox: Automatch Item, Select In Other Combobox, Remove From Both
I have 2 comboboxes and a listbox. I want the user to select an item from one combo, with then matches the item to its corresponding item in the 2nd combo, then add both to a list box. The user can either select from the 1st combo or from the 2nd...either one will match to the corresponding item in the other. Both comboboxes also have to be autocompleting. Once the selection is added to the listbox, the user can remove it which will delete the item from the list and add them back into the appropriate comboboxes. I have this working except for one thing.

When autocompleting, if the user types in what they want and its found and they hit ENTER, I am getting an error when trying to remove the item from the combos. It tells me the index is invalid and sure enough, when I check what the index is, its -1. It seems that the user isn't selecting an item in the combo even though its matched.

This is what I tried. It works if an item is clicked or chosen by pressing the up/down arrows. It also works if they type what they want, its matched, then they press up/down or some other number but will NOT work if they just type it, its found and they hit enter:


Code:
Private Sub cmdAdd_Click()
List1.AddItem cmbo(0).Text & " " & cmbo(1).Text

cmbo(0).RemoveItem (cmbo(0).ListIndex)
cmbo(1).RemoveItem (cmbo(1).ListIndex)

End Sub

Oddly, if I put the opposite combo item to be deleted, it works...so, if I just selected something from combo 1, the following works:


Code:
Private Sub cmdAdd_Click()
List1.AddItem cmbo(0).Text & " " & cmbo(1).Text

cmbo(0).RemoveItem (cmbo(1).ListIndex)
cmbo(1).RemoveItem (cmbo(1).ListIndex)

End Sub

Any ideas anyone? Perhaps I need to post the function I use for autocompleting? Let me know please...

Flexgrid To Flexgrid Using Text Matrix
i know i have to use text matrix but how can i send a specific cell, i.e if the colour of the text in the cell changes colour i.e green. how can i make the flex grid pick that up as 1 attempt and carry on for as many attempts the user makes.

the colour will only change if the user has got the wrong answer.
the flexgrid is on a seperate form.

Move Flexgrid Content To Another Flexgrid
How can I grab all of the data in a MSFlexgrid and transfer it to another MSFlexgrid in another form? Can I do this without requerying the data?

Ping From FlexGrid VB6 {print From Flexgrid}
I designed a program that have Flexgrid

how can I print teh data from this flexgrid


thank's
NEWBIE

How Can I Transfer Data From One Flexgrid To Another Flexgrid.
hi everyone i am back with more questions. i have a FORM1 With a flexgrid and a "Load" button

flexgrid1 has cols ProductName, VendorName, QuantityPerUnit, UnitPrice, ReorderLevel and Discontinued . the database i am connecting to is SQL Server example-"Northwind"

The value in column Discontinued is all "false" when flexgrid is loaded.
when the user clicks on a any row the Discontinued value changes to "Ture".
When the button Load is clicked all the rows that have the Discontinued Column value as "true" have to be loaded in FORM2 .

FORM2 has a "Print"button and flexgrid2 with columns ProductName, VendorName and Discontinued.

so my basic question is how do i load the data in FORM1 , FLEXGRID1 to FORM2 , FLEXGRID2 and also make changes to the database.

if i am not clear please let me know . any kind of answere would be of great help,thank you

Shiny

Text In Combobox Appears In Combobox Field
Hi,
Anyone know how to select the text in a combobox when the user types in its field? For example, if the use types Fr in the combobox field , the selected item would be France and would appear in the combobox field from a list say consisting of [Spain, Portugal, France].
Thanks.

[Solved] How To Change The Content Of An Combobox With An Other Combobox
Hi, I'm new,
but I already have a question:

How do I Change the content of an combobox by choosing the things in an other combobox?

For example, there are two comboboxes. They are both about color.
In the first combobox you select a color like purple, green and blue.
Once you've selected blue, the other combobox comes active, and you can select light blue, normal blue or dark blue.

What I'm creating is a program "for restaurants". It has two comboboxes. In the first combobox you choose the "Type or order", like noodles, rice or pizza. After you've selected something, an other combobox becomes active. If you've selected pizza in the first combobox, then the content of the second one is like: Pizza Hawaii, Pizza al tonno, Pizza BBQ. But, if I selected rice in the first combobox, then the second combobox should give the options "Rice with vegetables" and "Rice with chicken".

This is the code I've written:

Private Sub CommandButton1_Click()
lstOrderlist.AddItem cmbGerecht
End Sub

Private Sub CommandButton2_Click()
lstOrderlist.Clear
End Sub

Private Sub UserForm_Initialize()
cmbSoort.AddItem "Noodles"
cmbSoort.AddItem "Fried rice"
cmbSoort.AddItem "Pizza"

If cmbSoort = Empty Then
cmbOrder.AddItem ""

ElseIf cmbSort = "Noodles" Then
cmbOrder.AddItem "Noodles with chicken"
cmbOrder.AddItem "Noodles with beef"
cmbOrder.AddItem "Noodles with grease"

ElseIf cmbSort = "Fried rice" Then
cmbOrder.AddItem "Rice with chicken"
cmbOrder.AddItem "Rice with beef"
cmbOrder.AddItem "Rice with grease"

ElseIf cmbSort = "Pizza" Then
cmbOrder.AddItem "Pizza Al Tonno"
cmbOrder.AddItem "Pizza Hawaii"

End If
End Sub

Somehow, the second combobox remains empty.
Can someone tell me what I'm doing wrong??

BTW, to make things clear: cmbSoort is the "first combobox" from the example, and cmbGerecht is the second one.


Picture of the program with the names of the comboboxes (some words are in Dutch language):


The word-document (I created it with VBA in word):
http://www.megaupload.com/?d=QZETEAQ3
(sorry I don't know any other host)

Soo....I hope I'm being clear. Can someone help me out with this please? I really need to figure this out quick

Edit: The combobox problem is solved now, but not I've encountered 2 other things I need to solve, them it's done. See last reply.

VB6 Combobox Behave Like VB3 Combobox When Deleting Items
I have a fragment of combobox code from a VB3 legacy application, which isn't working the same when ported over to VB6.

I have a combobox with the 'Dropdown List' style, to which I've added several items. In VB6 if the combobox dropdown list is displayed, and the delete button is pressed, the combobox defaults to the original value. In VB3, the combobox items are deselected (ie. combo1.ListIndex = -1).

Here's the code -

VB Code:
Private Sub Form_Load()    Combo1.AddItem "Sample1"    Combo1.AddItem "Sample2"    Combo1.AddItem "Sample3"    Combo1.AddItem "Sample4"    Combo1.AddItem "Sample5"        Combo1.ListIndex = 0End Sub Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)    If KeyCode = KEY_DELETE Then        Combo1.ListIndex = -1    End IfEnd Sub

So I select an item from the first combobox, ensuring that the dropdown list is displayed -


While the dropdown list is displayed, I press the delete key -


I then select another control, so the focus is lost from the combobox -


Notice in the above picture, that instead of a blank selection I get the original item instead. In VB3, performing these steps results in a blank selection instead.

Without changing the Style to 'Dropdown Combo', or removing the deletion function, is there a way I can get this program to behave the same way in VB6 as it does in VB3?

How To Link A Combobox From A Database To A Combobox On A Form.
Goodday There,

I have a problem with linking a dropdown combobox from the database to a dropdown combobox in a form, Please help and I'm using access database by the way.

Thank you in advance...

Mfanelo

ComboBox - Displaying Database Values In A ComboBox
I am trying to insert values from a database into a combo box.

I have linked the datacontrol to the combo box and values from the database are displayed within the combox box. However can only be navigated using the data control. I would like the values to be listed within the drop down list of the combo box.

Can anyone help pls?!?!


Roshny

Filling A Combobox From Database But I Don't Want Duplicates In Th Combobox.
I want to output the contents of a database field (ms access) to a combobox but the field has many duplicates that I wish not to display. I just want one of each. Thanks

ComboBox Contents Are Longer Than The Size Of The ComboBox
My comboBox contents are longer than the size of the comboBox, how can i make the content to show when pointed by the mouce, so that the user can read the whole string and make selectin

Thanks

Filling A ComboBox Depending On Another ComboBox
Hi,

I want to fill a Combobox (cmb2) dependent on what the user has chosen in a first ComboBox (cmb1).

The first combobox ist based on a table, and the second combobox shall be filled with lines from another table, where only the lines are chosen that are relevant, fx:

table for cmb1:
A
B
C
D

Table fro where you choose the rows for cmb2:

A Boston
A Washington
A Baltimore
B Chicago
B Miami
C San Francisco
D Miami
D New York
D Los Angeles
D Las vegas

If the user chooses "A" in cmb1, in cmb2 shuld there so be only rows from the second table, where the first column is A.

Is there anybody out there who knows a solution?

Thank you very much!!

Combobox -- Database, Selection In Combobox
I am confused, and i am hopping that i write my problem acurately

I have combo boxes, which are filled from Data from the database when loading the form, each combobox filled with different tables. Lets assume each Table has TWO fileds 1. Code 2. Name. And I filled Combobox with "Name" filed values. In some Table "Code" is Integer/Number and in some tables it is "Text" filed.

Now what i actually want to do are following
1. I say to combobox to select/display "Name" of "Code" = 51, or "Code" = "AC01244"

2. When user select any Name form Combobox I get "Code" correspond to that "Name"

I try the following code but i could not resolved fully and specially for "Code" when it is Text.


VB Code:
' in Load form function     ' Text 0001    m_strSQL = "SELECT * FROM Programs ORDER BY code"    m_rsCommon.Open m_strSQL, m_conDatabase, adOpenForwardOnly, adLockReadOnly, adCmdText    If m_rsCommon.RecordCount > 0 Then        m_rsCommon.MoveFirst        For iLoop = 1 To m_rsCommon.RecordCount            'm_rsCommon.Fields ("code")            cmbPrograms.AddItem m_rsCommon.Fields("Name")            cmbPrograms.ItemData(cmbPrograms.NewIndex) = m_rsCommon.Fields("code")            m_rsCommon.MoveNext        Next    End If    m_rsCommon.Close     ' Text AC030001    m_strSQL = "SELECT * FROM Accounts ORDER BY AcCode"    m_rsCommon.Open m_strSQL, m_conDatabase, adOpenForwardOnly, adLockReadOnly, adCmdText    If m_rsCommon.RecordCount > 0 Then        m_rsCommon.MoveFirst        For iLoop = 1 To m_rsCommon.RecordCount            'm_rsCommon.Fields ("AcCode")            cmbAccounts.AddItem m_rsCommon.Fields("AcName")'            cmbAccounts.ItemData(cmbAccounts.NewIndex) = m_rsCommon.Fields("AcCode")            m_rsCommon.MoveNext        Next    End If    m_rsCommon.Close     ' Number    m_strSQL = "SELECT * FROM ROs ORDER BY EntryNo"    m_rsCommon.Open m_strSQL, m_conDatabase, adOpenForwardOnly, adLockReadOnly, adCmdText    If m_rsCommon.RecordCount > 0 Then        m_rsCommon.MoveFirst        For iLoop = 1 To m_rsCommon.RecordCount            'm_rsCommon.Fields ("EntryNo")            cmbROs.AddItem m_rsCommon.Fields("RO_Details")            cmbROs.ItemData(cmbROs.NewIndex) = m_rsCommon.Fields("EntryNo")            m_rsCommon.MoveNext        Next    End If    m_rsCommon.Close



VB Code:
' Select Name in Combobox according to their/passing Code VAluesPrivate Sub Command2_Click()'    cmbPrograms.ListIndex = (cmbPrograms.ItemData(73))'    cmbAccounts.ListIndex = (cmbAccounts.ItemData("AC00254"))    cmbROs.ListIndex = (cmbROs.ItemData(4360))End Sub ' Display Selected "Code" Private Sub Command1_Click()'    Debug.Print cmbPrograms.ItemData(cmbPrograms.ListIndex) 'Dispaly 77 even i passed 73    Debug.Print cmbAccounts.ItemData(cmbAccounts.ListIndex)     Debug.Print cmbROs.ItemData(cmbROs.ListIndex) ' Display 4706 even i passed 4360End Sub


I hope i am able to clear my problem

I am really looking for answere.... please give me any tip, example to overcome this problem

Thank to all in advance...

Flexgrid Search/Add To New Flexgrid
Last part of my problem...I have this search function that searches through a flexgrid I have on my interface, and it works great...now what I need to do is bring each record that is found into a separate flexgrid with the same properties as the parent flexgrid, with just the records that were found...
any suggestions?


This is my search function:



VB Code:
Sub Search()    Dim target_name As String, sResult As String    Dim r As Integer, c As Integer, sResultArray() As String, sra As Integer        target_name = UCase$(InputBox("Letter", "Letter"))    If Len(target_name) = 0 Then Exit Sub        With grd        .Redraw = False        .FillStyle = flexFillRepeat        .Col = 1: .Row = 1        .ColSel = .Cols - 1        .RowSel = .Rows - 1        .CellBackColor = vbWhite                For r = 0 To .Rows - 1            For c = 1 To .Cols - 1                If .TextMatrix(r, c) Like target_name & "*" Then Exit For            Next c            If c < .Cols Then                For c = 1 To .Cols - 1                    sResult = sResult & vbTab & .TextMatrix(r, c)                Next c                 sResult = vbNullString            End If        Next r        .Col = 0: .Row = 0        .Redraw = True    End With        MsgBox "Finished!"            End Sub

Saving Data From Flexgrid To CSV And Loading Data From CSV To Flexgrid
I am creating database application that will allow the user to:
2, load data from a CSV file into the flexgrid
3, save data from flexgrid into a CSV
and i have a couple of questions

1, how do i make the application load the data from a specific CSV file 2, how do i make it so that the user is able to add information to the data and then save that information and over write the current CSV file
3, how do i make it so that i can delete data from the flexgrid and ake all the information below to make up"
it would be very helpful if someone could give me the code so that it works or atleast point me in the right direction as i have tried many things and i just dont know why its not working

the code that i currently have to save the data from the flexgrid to a CSV is as follows, though i can save the file it doesnt save any of the data from the flexgrid into the CSV file:
Private Sub cmd_Save_Click()
Dim strGameName As String
Dim strGenre As String
Dim strAge_Rating As String
Dim strStock As String
Dim strFormat As String
Dim strTextout_1 As String
Dim strTextout_2 As String
Dim strTextout_3 As String
Dim srrTextout_4 As String
Dim strTextout_5 As String
With CommonDialog1

' Sets the default directory/folder

.InitDir = "N:Unit 29"

' Sets the Dialog Title to Open File

.DialogTitle = "Please Save File"

' Sets the File List box to Word and Excel documents
'make sure the following is all on one line

.Filter = "CSV (*.CSV)|*.CSV"

' Set the default files type to Word Documents

.FilterIndex = 1

' Sets the flags - File must exist and Hide Read only

.Flags = cdlOFNFileMustExist + cdlOFNHideReadOnly

' Set dialog box so an error occurs if the dialog box is cancelled

.CancelError = True
End With
' Enables error handling to catch cancel error
On Error Resume Next
' display the dialog box
CommonDialog1.ShowSave
If Err Then

' This code runs if the dialog was cancelled

MsgBox "Dialog Cancelled"

Exit Sub
End If
Open CommonDialog1.FileName For Output As #1
Write #1, strGameName, strGenre, strAge_Rating, str_Stock, strFormat
MsgBox "You selected " & CommonDialog1.FileName
strTextout_1 = strGameName
strTextout_2 = strGenre
strTextout_3 = strAge_Rating
srrTextout_4 = strStock
strTextout_5 = strFormat
'Write #1, strTextout_1, strTextout_2, strTextout_3
Close #1
End Sub
and this code is what i currently have to load the data from a CSV file into the flexgrid, and well it jsut doesnt:
Private Sub Form_Load()
Dim strGameName As String
Dim strGenre As String
Dim strAge_Rating As String
Dim strStock As String
Dim strFormat As String
Open "Game Rent" For Output As #1
strTextout_1 = strGameName
strTextout_2 = strGenre
strTextout_3 = strAge_Rating
srrTextout_4 = strStock
strTextout_5 = strFormat
Write #1, strGameName, strGenre, strAge_Rating, str_Stock, strFormat
Close #1
'With CommonDialog1
'

' Sets the default directory/folder
' .InitDir = "C:"
'

' Sets the Dialog Title to Open File
'

.DialogTitle = "This is my Open File dialog"
'
'

' Sets the File List box to Word and Excel documents
''make sure the following is all on one line
'

.Filter = "Notepad (*.txt)|*.txt"
'
'

' Set the default files type to Word Documents
'

.FilterIndex = 1
'

' Sets the flags - File must exist and Hide Read only
'

.Flags = cdlOFNFileMustExist + cdlOFNHideReadOnly
'

' Set dialog box so an error occurs if the dialog box is cancelled
'

.CancelError = True
'End With
'
'' Enables error handling to catch cancel error
'On Error Resume Next
'' display the dialog box
'CommonDialog1.ShowOpen
'If Err Then
'

' This code runs if the dialog was cancelled
'

MsgBox "Dialog Cancelled"
'

Exit Sub
'End If
'' Displays a message box.

Open "Game Rent" For Input As #1
Input #1, strGameName, strGenre, strAge_Rating, str_Stock, strFormat
'Print strTextout_1, strTextout_2, strTextout_3, strTextout_4, strTextout_5
MSFlexGrid1.TextMatrix(intRowNumber, 0) = strGameName
MSFlexGrid1.TextMatrix(intRowNumber, 1) = strGenre
MSFlexGrid1.TextMatrix(intRowNumber, 2) = str_Age_Rating

One Combobox Relies On Another Combobox
still no solution here. i have two comboboxes, the first one uses a rowsource and gets a list of the tables and works beautifully, now the 2nd combobox is suppose to get the list of fields from the table chosen in the 1st box. Now if i hard code a name of a table in my code i get a list of fields, so i know the algorithm works properly, but the first box doesn't seem to be in scope. i tried combobox1 and combobox1.text. the 2nd combo is also a rowsource - is that my problem? i dun know of any other way to go about it, so here is my code and if u know of another way, i'd love some advice. or maybe just a way to make the first combobox global?

Option Compare Database
Option Explicit

Function ListFields(fld As Control, id As Variant, _
row As Variant, col As Variant, code As Variant) As Variant

Dim dbs As Database
Dim dbfield As Field
Dim tdf As TableDef
Static strFields(20) As String
Static cntr As Integer

Select Case code
Case acLBInitialize
Set dbs = CurrentDb
Set tdf = dbs.TableDefs("Contacts")
cntr = 0
For Each dbfield In tdf.Fields
strFields(cntr) = dbfield.Name
cntr = cntr + 1
Next dbfield
ListFields = cntr
Case acLBOpen
ListFields = Timer
Case acLBGetRowCount
ListFields = cntr
Case acLBGetColumnCount
ListFields = 1
Case acLBGetColumnWidth
ListFields = -1
Case acLBGetValue
ListFields = strFields(row)
Case acLBGetFormat
Case acLBEnd
Erase strFields
End Select
End Function

Combobox Affecting Another Combobox.
Hi guys, I am trying to create a column of dropdownlists and someone in another forum said I just have to just a combobox to do it. What happens is these comboboxes will have 2 values(or choices) inside them. The choice of the values inside the other comboboxes will change depending on the choice the user chooses for the first combobox.

As this is new to me I am trying it step by step by creating the combobox first.
I set the style to 2 so that it becomes a dropdown adn the user will not be able to input anything inside.

However, I can't input anything inside the Itemdata or List. Same goes for the text.

I found that the text can be changed is 0 is chosen for the STYLE but this is not what I need as the user will then be able to input values inside.

So my question at this point is how do I put a list of words or values inside the combobox?

GUI Editing
Anyone got an example i mean like Editing the top frame with images etc?

MP3 Tag Editing
Can anyone help me learn how 2 make a program that will edit and add tags to files like mp3, wma, wmv etc-Esp mp3 and wmv thanx
Examples or code libraries would b extremely useful cos i learn by example the best cos i can edit the working code 2 see what everything does

VB Exe Editing
I have noticed that some companies (even smaller ones) customize the exe you download to include the license information. Is this possible with a vb exe? I would like my php scripts to inject the logged in user information into the exe they download, mainly for piracy reasons. Any suggestions?

MP3 Tag Editing
I am working on a program for editing mp3 tags. It has been easy to find code for everything except how to get the Track Number. I am stuck....Any Help, Please?
TIA

.wav Editing..
I'm not sure what forum this goes under so im putting it here, I'm makeing a program and i want to make my own sound files..but when ever i go to make one in say sound recorder it has this ring in the backround.. I'm wondering if there is a way to get rid of that ring so the sound is clearer.

Editing
please help me

if i edit data in my database and delete info from a field and save it, it does make the change, and when i want to move to the next or previous record it gives me an error that the field cannot be a null value.

i have used adodc control and ado code both give the same error... and in my dbase the field is not required.(ACCESS97 is the data base that i use)

edward

Editing A VB DLL
Hey guys,
I have a VB DLL in COM+ that is being called from an ASP page. I want to add a function to the VB DLL. If I just add the function and recompile the DLL by doing file->make dll, will I break compatibility? What is the correct way or recompiling the dll. By the way the compatibility is set to binary. Thanks in advance.

Editing
I am using the following:

Private Sub cmdCalendar_Click()

Dim D, UserDate As Date

D = datCalib.Recordset.Fields("LastCalibrated").Value

Set Dcntrl = txtLast
DateVal
txtLast.SetFocus

If txtLast <> "" Then
If IsNull(D) And Val(txtCal) = 0 Then
fcFrame_CalWeeks.Visible = True
fcCbo_CalWeeks.SetFocus
SendKeys "{F4}"
Else
Next_Cal_Due
End If
Else
txtCal = "0"
rotxtNext = Date
End If

End Sub

This works for me great, my problem is that when there is a date in txtLast, fcFrame_CalWeeks does not appear and I need it to when I edit the data. Anyone got any ideas for me.

Thanks in advance

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