Trying To Fill Up A Felx Grid. But It Wont Fill
Hi im trying to write some code for a flex grid to display the ContactMethod and then Contact information. they come from different tables. but i have a nice sql for it and it wont fill in at all. it just displays blank boxes every time.
i have on my form load to call in this order FormatGridBefore FillGrid FormatGridAfter
heres the codes:
Private Sub FillGrid() strsql = "SELECT tblALLcommunication.CommMethod, tblEMPLOYEEcontact.Connection FROM tblALLcommunication INNER JOIN tblEMPLOYEEcontact ON tblALLcommunication.CommID = tblEMPLOYEEcontact.CommID" Set rs2 = New ADODB.Recordset rs2.Open strsql, cn, adOpenKeyset, adLockOptimistic, adCmdText Set flexcontacts.DataSource = rs2 flexcontacts.Refresh rs2.Close Set rs2 = Nothing End Sub
Public Sub FormatGridAfter() With flexcontacts .ColWidth(0) = 1520 .ColWidth(1) = 1520 .ColWidth(2) = 3037 End With End Sub
Public Sub FormatGridBefore() flexcontacts.FixedCols = 0 End Sub
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Fill Listview Then Double Click To Fill Text Boxes (Resolved)
Hello
I have been working on this project off and on for about 6 months. What I am trying to do is use a text box search and fill a list view with the results. Then select the one I want and have it populate some text boxes on another form. all the fields can contain alpha numeric characters. I have attached the program. If any one can help me it would be greatly appreciated. I have been trying various combinations but have had no success.
Thanks
Bob
Edited by - Bob Taylor on 7/29/2003 4:08:49 PM
Db Grid Fill Down
Can you make it fill down or make 1 cell the same as the one above it?
i.e date colum
26/4/01
(make this cell = the one above it, 26/4/01)
thanks heaps
Fastest Way To Fill A Grid From A Db?
Hi,
I have a requirement to retrieve approx 10 - 20K records (12 colomns) into a grid of some form. The SQL retrieval is very fast and not an issue. Although I haven't been asked, I suspect the users will want to update the grid and eventually the changes be saved back to the db. My questions:
- what is the best control (Flexgrid?) for this type of thing?
- what is the fastest way to fill the grid?
Thanks
Neil
How To Speed Up A Grid Fill
hi, im filling a grid, the problem is that when i have 10+ items, i can see how the grid is being filled, that on a AMD 2200+, so I dont want to see what happens in a P300, is there any way to load it faster or smoother, this is the code im using
thanks
Code:
For i = 2 To GRDNotas.Cols - 2
GRDNotas.Col = i
GRDNotas.Row = 0
For j = 1 To GRDNotas.Rows - 1
rs.MoveFirst
GRDNotas.Col = 0
GRDNotas.Row = j
While Not rs.EOF
GRDNotas.Col = 0
If GRDNotas.Text = rs.Fields("code") Then
GRDNotas.Col = i
If GRDNotas.Text <> "" Then
GRDNotas.Text = GRDNotas.Text & "-" & rs.Fields("Nota")
Else
GRDNotas.Text = rs.Fields("Nota")
End If
End If
rs.MoveNext
Wend
Next j
rs.Close
Next i
Fill Textboxes With Selected Row In A Grid ()
I am using a grid(MSHFelexGrid)
I need to fill some textboxes according to the row selected in agrid,
but when I move by the arrows keys, I dunno which evnt can capture the arrow key presswed. Could any one tell me how to do this? Thank you very much.
Fill Data Grid With Record Source?
I'm a little rusty at VB database programming. I need to know how to set the record source of a datagrid at runtime because I am hard codeing the connection
Fill An Unbound Datagrid (or Plain Grid)
I'm a self-taught VB programmer, out of necessity. I don't like to use persistent connections to a database, and therefore use unbound controls. It's been fairly successful. HOWEVER...
How would I load a grid from a recordset without being connected via a dataenvironment? I want to load the grid and navigate it without a connection to a recordset. Kinda like loading a listbox or combobox. Once loaded, I can pull the unique key from the selected row for use in various outlandish ways.
I thought it would be as simple as "DataGrid1.AddItem" (or "Grid1.AddItem"). Nope. I'm sure it's a relatively simple thing to do, but I'm stumped. It must be Friday...
Randy
Pass Parameter-Fill A Data Grid
My first VB project and I am getting this error on my second try at the
project, select command with a parameter--running the data sets works in
data adapter, however . . .
An unhandled exception of type 'System.InvalidCastException' occurred in
mscorlib.dll
Additional information: Object must implement IConvertible.
Short Story Version:
1-List of Staff Members in an Access Table
2-Tracking for Approval--another table linked by Staff ID
3-List Box in VB from Staff Members Table to list and select staff members.
4-Need a grid that will respond by showing Staff Member chosen with open
Approvals, allow them to change on field, Approved No to Yes and save it to
the Access Table.
Tried Parent/Master.
Tried select command with a parameter.
Any help for a rookie? Thanks!
Tami Lawson
Data Analyst
Midway College
512 E. Stephens Street
Midway, KY 40347
(859) 846-5786
Question With Grid Auto Fill - SOLVED
I have a small with VSFlexGrid. Properties I set with thin grid are
With fgMaintenance
.Clear
.Rows = 1
.Cols = 0
.Enabled = True
.FillStyle = flexFillRepeat
End With
Now I want to handle the event, for example
if the user highlight 5 columns and type in value as "12". Its populating the value 12 in all the highlighted cells, thats good. But the problem is with this kind of selection my AfterEdit event is not being called except the first cell. Where should I keep track of other changes? What event will it fire for the rest of the changes? thanks for your help.
BTW, we are using VB 6.
Edit:
I just solved this issue by handling the "CellChanged", thanks
Edited by - mrrambabu on 9/22/2003 10:33:08 AM
Question With Grid Auto Fill And VSFlexGrid, Please Help - Solved
I have a small with VSFlexGrid. Properties I set with thin grid are
With fgMaintenance
.Clear
.Rows = 1
.Cols = 0
.Enabled = True
.FillStyle = flexFillRepeat
End With
Now I want to handle the event, for example
if the user highlight 5 columns and type in value as "12". Its populating the value 12 in all the highlighted cells, thats good. But the problem is with this kind of selection my AfterEdit event is not being called except the first cell. Where should I keep track of other changes? What event should I handle to keep track of changes in all the other cells? thanks for your help.
BTW, we are using VB 6.
I solved the issue by handling the CellChanged event, thanks
MS Felx Grid Setting
Hi,
I have set up MS Flex grid control to resize the height when in from
resize event.
But it didn't work. I can resize the width with no problem.
Does anybody know if it's a bug or something I did wrong?
With FGReport
.Width = frmReport.Width - 600
.Height = frmReport.Height - 600
End with
Fill Listbox/datalist Using Result From SQL Query, Then Use Listbox To Fill A 2nd Listbox
Need some code that will fill a listbox or a datalist with the result of a SQL query
(the result will really just be many single fields ie. EMP00001, EMP00002, EMP00003 etc. and I need these passed one by one to the listbox/datalist).
Also, when they have been instantiated, I will need the current (hightlighted) item in the listbox at the time to be used
to populate a second listbox/datalist <----- Assuming another SQL query will be necessary?
Can anyone help with the code for this?
And which is better to use for this purpose - a listbox or datalist?
Fill
I'm making a programme that has parts simular to microsoft paint (I dont want to use OLEs), but there is one problem. I cannot recreate the fill tool. Please can somebody please just tell me how it is done. Thankyou.
Fill Down To Last Row
I'd like to fill down the formulas in the first row (columns AC through AN) to the last row that has anything in it.
Column V will always have something so that could be used as a reference. I'm green at programming but I think this could be an easy project with VB and I'd appreciate some help.
How To Use My Dll Fill In Vb6
Hi,
I created a dll file by vb6. Then I want to use this dll file in vb6, how can I use? when i typed "Public function xxx lib "c"xxxxxx.dll" (byVal a as long)"
but there is come out the error ("there is no entry point"), how can i fix it?
another problem, the dll is put long type parameter and return defined type array, so how can I used this dll file?
thx
Fill Irregular
I'm making a vector graphics game, and I need an extremly fast function to insert color between irregular shaped polygons. Thanks
Create Fill
Hello Everybody!
I am a High School student and am new to VB graphics methods.
Can anyone plz tell me how do I create the fill-bucket?
I have tried using the api function from the net.. But the diff. fillstyles won't
work . (possible??)
Also, after using the fill tool, all the circle and squares get filled with black
which is a nuisance.
If u can help me then I will be very thankful :-)
Rajarshi
Fill With Color
hi everyone,
this is my first graphic app- creating a function that fills an area in an image with a certain color. much like the one in ms paint.
my first and only idea was to use the Point and PSet methods of a picbox, in a recursive function that paints the given x,y point. it also checks the 4 surrounding pixels and if they are in the same area it sends them to the same function recursively.
a stack over-flow error doesn't take too long to pop-up it works for about a 20x20 area MAX!
can anyone guide me in the right direction?
Gradient Fill
Hello,
I was trying to create a gradient fill for a background and found this great code. But am having trouble modifying it.
I only need 2 colors and the gradient to go from top to bottom. I'm new at this and have tried switching the ScaleHeight and Width and have not had much luck can anyone assist me?
Thanks!
Code:
Private Sub Form_Resize()
' Form resized so redo the gradient
Dim hw As Single, rd As Single, bd As Single, gd As Single
Dim r As Single, b As Single, g As Single 'from colors
Dim dr As Single, db As Single, dg As Single 'to colors
Dim sw As Single
Dim i As Long
sw = ScaleWidth
r = 0: g = 255: b = 0 'from Red
dr = 0: dg = 0: db = 255 'to Blue
' r = 192: g = 0: b = 192 'from Dark Magenta
' dr = 255: dg = 255: db = 255 'to White
hw = sw / 2 'Determine the range to the middle of the form
rd = (dr - r) / hw 'Red Delta = change in Red / Range (color change per pixel)
gd = (dg - g) / hw 'Green Delta
bd = (db - b) / hw 'Blue Delta
For i = 0 To hw 'From the edge to the middle
Me.Line (0 + i, 0)-(0 + i, ScaleHeight), RGB(r, g, b) 'draw left vertical line
Me.Line (sw - i, 0)-(sw - i, ScaleHeight), RGB(r, g, b) 'draw right vertical line
r = Add(r, rd) 'Increment (or decrement) red by the delta
g = Add(g, gd) 'Adjust Green
b = Add(b, bd) 'Adjust Blue
Next
End Sub
Fill In A Triangle. Can An API Be Used To Do This?
Hi, some of you know that I am making a 3D Engine.
That 3D Engine uses triangles(The most common and basic object used in most 3D Engines) well know I have made the wireframe rendering, but I need to fill in the triangles with a color.
Is there any API to do this or what?
Please show me an example of how to do it in a picture box.
Thanks alot in advance.
Julian.
Fill Colour
Is there anyway of setting a shapes fill properties to semi-transparent where the shape is coloured but a bitmap image underneath may still be seen through it?
Flood Fill
i have a rather irregular problem. it's not like the other flood fill ones i've looked up.
i've made my own graphics program. but it works in small numbers like32x32 pixels. like a crappy kind of icon maker. i can't get the flood fill to work. can someone send me the algorythim just for filling an irreguallar area, so i can apply it into the program, since it does not use conventional bmp methods.
hope you can help.
Fill Color
I have a picture box name picture1, and I draw a square on that picture box like:
picture1.line (x1, y1) - (x2, y2)
picture1.line (x2, y2) - (x3, y3)
picture1.line (x3, y3) - (x4, y4)
picture1.line (x4, y1) - (x1, y1)
(x1, y1 ... is variable and is 4 corner of the square)
Now I want to fill color for that square.
Any idea?
Fill A Circle?
is there a way to fill a circle with a color without going
me.fillstyle = vbsolid
me.circle (x,y),r,Color
because i have multiple objects on the screen. and i want some to be colored in and some not.
Auto Fill
Hi, I'm really new a VB.
I'm trying to get excel to autofill some cell (the amount of which determined by the value in the selected cell) above the selected cell.
I've got this and I know it wont work and its going to be the syntax but can someone explain. to me where I'm going wrong.
Thanks in advance,
Cheesemunger
Code:
Sub insertautofill()
Dim j As Integer
Dim before As Range
Dim offset As Range
j = ActiveCell.Value
before = ActiveCell.Range
offset = ActiveCell.offset(0, -j)
For i = 0 To j
Selection.EntireRow.Insert
Next i
Range("before").Select
Selection.AutoFill Destination:=Range("offset:before"), Type:=xlFillDefault
End Sub
Combo Box Fill
Is there an easy way to add for instance.....
all dates between 1950 to 1999 without having to write
combo1.additem "blah blah"
every single time?
ps. i dont want to create a text file with them all in because that will take basically as long.
Fill IE Without Navigation
There seem to be a few web queries of late so thought I would add another one.
I want to fill in a web form without navigating to the site (this isn't possible...tried various methods but it's a company built web site thingy).
For eg, Google: http://www.google.co.uk/advanced_search?hl=en
If I wanted to populate the all of the words box, it has the html code:
HTML Code:
with <b>all</b> of the words</font></td><td><input type=text value="" name=as_q size=25>
I would do something like
Code:
appactivate "Google Advanced Search"
That would take me to the application window. Now the tricky part, I think.
How can I reference to that currently selected IE window and fill in that box, named as_q?
I've tried a query along these lines in the past but haven't put it this way yet.
So I can't use the standard of something like (taken from a recent post because I don't have the exact code, but you should get the jist of where I'm going):
Code:
Dim objIE As SHDocVw.InternetExplorer
Set objIE = CreateObject("InternetExplorer.Application")
then the navurl command, I want to switch the view to an existing browser that is holding on the web page I want to fill in, then reference the boxes.
All of the examples here and on the web seem to be from navigating to the site, but I can't do that (honestly). I just want to control/reference an existing browser window, if possible.
I'm experimenting with sendkeys (yeah I know, hence this post) but as expected it is intermittent and can do something totally different of what I want to do, which is bad!
If I can get to grips with the basics then hopefully I can adapt it to my needs.
ListBox Won't Fill
I am using an embedded ListBox and running the code below but the ListBox will not "fill" (show the list of new data) unless I physically select off the sheet that houses the ListBox and then select back to the sheet.
Any Idea's??
As always..Thank You!!!!
Code:
Private Sub CommandButton1_Click()
Dim rngCell As Range
Application.ScreenUpdating = False
Sheets("Data Sheet").Range("O2:AA2500").ClearContents
With Sheets("Data Sheet")
For Each rngCell In Sheets("Data Sheet").Range("L2:L" & .Range("L2").End(xlDown).Row)
If rngCell.Text = TextBox1.Text Then
rngCell.Offset(, -11).Resize(, 12).Copy _
Sheets("Data Sheet").Range("O65536").End(xlUp).Offset(1, 0)
ElseIf rngCell.Text = TextBox2.Text Then
rngCell.Offset(, -11).Resize(, 12).Copy _
Sheets("Data Sheet").Range("O65536").End(xlUp).Offset(1, 0)
ElseIf rngCell.Text = TextBox3.Text Then
rngCell.Offset(, -11).Resize(, 12).Copy _
Sheets("Data Sheet").Range("O65536").End(xlUp).Offset(1, 0)
ElseIf rngCell.Text = TextBox4.Text Then
rngCell.Offset(, -11).Resize(, 12).Copy _
Sheets("Data Sheet").Range("O65536").End(xlUp).Offset(1, 0)
ElseIf rngCell.Text = TextBox5.Text Then
rngCell.Offset(, -11).Resize(, 12).Copy _
Sheets("Data Sheet").Range("O65536").End(xlUp).Offset(1, 0)
End If
Next
.Columns("O:AA").Sort Key1:=.Range("Z2"), _
Order1:=xlAscending, Header:=xlGuess
End With
Sheets("Sheet1").Activate
Application.ScreenUpdating = True
Me.ListBox1.ListFillRange = "'Data Sheet'!O2:AA" & _
ThisWorkbook.Worksheets("Data Sheet").Range("O65536").End(xlUp).Row
Me.ListBox1.ListIndex = -1
End Sub
Select The Last Row For A Fill Down
I have a problem with selecting the last row. I have used the code below found on this site
Range("A2").Select
Selection.End(xlDown).Select
This give the last cell in col A which is fine. How do I then get it to select this entire row.
Please help
Paul
Fill In The Blanks
My problem is twofold: My column.select is "R", on the current sheet I have data in row 8 and 21 , I need to fill in the rows 9 thru 20 with the same data in rows 8 and 21, and second I need to have this code available for all sheets, column.select "R" is always the active column and the active row range is 1 and 39. In other words while traversing column "R" when the first none empty cell is encountered then copy that cell data to the next non-empty cell, there will always be only two cells in column "R" that have data.
Can you please help!
Fill Box With Gradient
Hello i want to make an expandeble menu, so i've added severel rectangles and now i want to fill them with a gradient. But it seems its just nog possible in VBA, the code i normally use in vb returns errors, so is there anyone who can tell me how i give a box a gradient color?
Greetingz
Fill Flexgrid
hi, someone know how i can fill my flexgrid by a recordSet????
Fill An Array
I think I've been staring at numbers too long because I can't seem to figure out an efficient way of doing this:
Create an array(1 to 8) where each element of the array is a unique random number between 1 and 9
Any help is appreciated
How Do You Fill Tree
Hello to all,
Here is a flat customer table
Before
===================
CustId Po# Last First Phone
-------------------------------------------------
101 12 don Joe 233-3333
101 13 Engish Errol 333-2322
101 16 Santiago Eddi 565-4443
104 56 Long Jimy 675-4333
67 Long Erol 567-3333
104 34 Creek Darson 567-3322
105 67 Eddit Mark 987-2333
107 34 Grant PRice 655-3333
After in a TreeView
====================
List of Customer
101
12 don Joe 233-3333
13 Engish Errol 333-2322
16 Santiago Eddi 565-4443
104
56 Long Jimy 675-4333
67 Long Erol 567-3333
34 Creek Darson 567-3322
105
67 Eddit Mark 987-2333
107
34 Grant PRice 655-3333
Notice: a blank in CustID -->104
Assume I have my recordset, now I need to fill
the TreeView with these data.
How do you loop thru the recordset and populate the treeview with these data. Somethimes
be a blank in CustId.
Thanks
Date Fill In
I dont have a real question...I just need some guidance or maybe other ideas...I have a table in a database that has many fields and one of them is the date field...I want to select all the records and fill in the missing dates(aka weeks that are nonexestent for example I may have '1/07/2001' and then '1/21/2001' I am missing the 14th and this is what I need to enter)...my idea to select the max_date and also the number of weeks like so (in sql)convert(integer,max(date)-min(date))/7 and then have a for loop that starts at max date and then continues to substract(for loop counter * 7) from max_date and finally queries the DB and if exists do nothing else insert a row with the date...this is very time consuming for a recordset that is above a couple...so I was wondering anyone else had a better or easier way to do it....hope that this makes some sense(like I have said before my explanatory skills are nonexistent)...Thank you
regards
jcd
Fill In Lines
CurrentX = 5000
CurrentY = 5000
Line -(3000, 6995), RGB(255, 0, 0)
Line -(5000, 9000), RGB(255, 0, 0)
Line -(7000, 7000), RGB(255, 0, 0)
Line -(5000, 5000), RGB(255, 0, 0)
I am trying to figure out how to fill in the area above - any ideas?
Thanks.
How Do I Fill An Array?
I want to fill a hoz. array with variables. Each row will have 8 variables as input and I don't know how many rows I will end up with.
I don't know where to start. Thanks
Fill A Combo Box
Ok... im a complete beginer... well sort of... a couple of days.
i have this form were people enter loads of data into different text boxes. well they are different peoples names..
then on the next form i want a combo box to list these names...
im sure there is a really easy way of doing this...
any suggestions???
Fill In The Blank
Could somebody tell me what would go instead of the HighlightText to highlight the text?
Code:
Private Sub text1_click()
Text1.HighlightText
End Sub
Thanks
Form Fill...?
I'd like to make a program to fill web Forms, i'v seen that here, but i can't find it...
can anyone help me?
Thanks
Fill New Table
I am running a vb application that returns a large amount of info from Linux (aprox. 30 lines) from an application that runs everyday and grabs this info. I need to create a new table in my database and send this info into it. Just wondering how I would start this? Do I need to tokenize? I believe this info is already separated by tab spaces, and if so could I insert this data into a new table by using the tab as some type of deliminator?
Just looking for the right direction to start running.
thanks
Fill FlexGrid
Hi
What is the fastest way to fill flex grid with recordset contains thousends of records.
Field Fill-In
I have a form which has a combo box with the procedures and revisions, and a text box in which the date on which an employee was last trained is entered. I want to call up the procedure in question, go to the date field, enter the date, and then have the procedure field update to reflect the appropriate revision. I think the code would be placed in the “After Update” property of the Date Last Trained field, and look like this:
/vba
SELECT dbo_ProcedureMain.id, dbo_ProcedureMain.ProcGroup & "-" & dbo_ProcedureMain.ProcNum & " " & dbo_ProcedureMain.ProcName & " Rev. No. " & dbo_ProcedureRev.RevNum FROM dbo_ProcedureRev INNER JOIN dbo_ProcedureMain ON dbo_ProcedureRev.ProcID=dbo_ProcedureMain.id WHERE dbo_ProcedureRev.AppDate < Forms![Date Last Trained];
//vba
When I run it, I get a syntax error.
I’m pretty sure this is not complete. I think there is a clause missing that puts the result of this code running into the Procedure/Revision field.
Where is(are) the problem(s)?
Thanks for your help.
Won't Fill Datagrid
hi,
I'm having a trouble with filling my datagrid. Everything works perfect, but the grid isn't filled at the end of the code...
Code:
connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=KBC.mdb;Persist Security Info=False"
Set con = New adoDB.Connection
con.Open (connectionstring)
sql = "SELECT Maatschappij.naam, Agentennummer.agentnrintern, Polisnummer.polisnrintern, Claim_definitief.datum, Claim_definitief.debet, Claim_definitief.credit" _
& " FROM Polisnummer INNER JOIN (Agentennummer INNER JOIN (Maatschappij INNER JOIN Claim_definitief ON Maatschappij.BVVO = Claim_definitief.BVVO) ON Agentennummer.agentnrextern = Claim_definitief.agentnrextern) ON Polisnummer.polisnrextern = Claim_definitief.polisnrextern" _
& " WHERE Maatschappij.naam= '" & BVVO & "' and Agentennummer.agentnrintern= '" & agent & "' and Claim_definitief.status=0"
Set rec = New adoDB.Recordset
rec.Open sql, con, adOpenKeyset, adLockOptimistic, adCmdText
datagridoverzicht.Visible = True
lblwv.Visible = False
txtwv.Visible = False
Set datagridoverzicht.DataSource = rec
datagridoverzicht.Refresh
sql en rec are doing perfectly...
Combobox Fill In
how can you make a combobox fill in with the records from an access data base?
example:when you have A database with table students and you wanne add 1 new you can only add 1 to a clas who realy is, and i want a combobox with the classes .
How To Fill This Text
I use label and the caption is "1234 - 345 - 1242 - 001" .I have four textbox, How I can fill it in the textbox just one click button using command button
|