|
hii
will this also work if i have this module??
Public Function AutoComplete(sTextbox As TextBox, sFlexGrid As MSFlexGrid, sDB As Database, sTable As String, sField As String) As Boolean
On Error Resume Next
Dim sCounter As Integer
Dim OldLen As Integer
Dim sTemp As Recordset
AutoComplete = False
If Not sTextbox.Text = "" Then
OldLen = Len(sTextbox.Text)
Set sTemp = sDB.OpenRecordset("SELECT * FROM " & sTable & " WHERE " & sField & " LIKE '" & sTextbox.Text & "*'", dbOpenDynaset)
If Not sTemp.RecordCount = 0 Then
If sTemp.EOF = True And sTemp.BOF = True Then
MsgBox "Not Matching Records", vbInformation, "Error"
Else
sTemp.MoveFirst
sFlexGrid.Clear
sFlexGrid.FormatString = "Book Name |ISBN |Author |Book In-Store"
Do While Not sTemp.EOF
sFlexGrid.AddItem sTemp.Fields(0).Value
sFlexGrid.TextMatrix(sFlexGrid.Rows - 1, 1) = sTemp.Fields(1).Value
sFlexGrid.TextMatrix(sFlexGrid.Rows - 1, 2) = sTemp.Fields(2).Value
sFlexGrid.TextMatrix(sFlexGrid.Rows - 1, 3) = sTemp.Fields(3).Value
sTemp.MoveNext
Loop
End If
If sTextbox.SelText = "" Then
sTextbox.SelStart = OldLen
Else
sTextbox.SelStart = InStr(sTextbox.Text, sTextbox.SelText)
End If
sTextbox.SelLength = Len(sTextbox.Text)
AutoComplete = True
Else
sFlexGrid.Clear
End If
End If
End Sub
this must be available in it.
so this means i put the code in the
Flexgrid or the form_load?
im not really sure
please tell me
thank you
Gary
|
|
|
|
|
Hi Gary
Could you elaborate on what it is exactly you are trying to do?
Is your question... When I select a row of info on a grid, how do I populate another page with the selected data??
Cliff
|
|
|
|
|
well the module is to select all the data from DB
when the textBox is fill the flexgrid will show the data in the flexgrid
so..
i want to know is that when i select the row of data using the code u gave me
it will show in other form, right?
then where should i put the code
in the flexgrid? module? or in the form_load?
actually you can ignore the module i send to you
and thank you Cliff
Gary
|
|
|
|
|
Hey Gary
Ok... Once you have populated your flexgrid:
You will select a row of data by clicking on the flexgrid row.
Then(just as example) you have a command button called cmdENTER.
When you have selected a row and then click cmdENTER,
you put the selected rows information in an array called strCustData.
It has been dimentioned to (0 to 12) because there are 13 columns in my
row.
'So this code will go in the same form as your selected flexgrid
'Copy this code into VB, it will be easier to read
Private sub cmdENTER_Click()
Dim strCustData(0 To 12) As String
Dim lngClientId As Long
Dim bytCount As Byte
With grdClients
'This just checks if a valid record was selected
If .TextMatrix(.Row, 0) = "" Or .TextMatrix(.Row, 1) = "N/A" Then
MsgBox "Please Select a Record"
Exit Sub
Else
'Sets my variable to the first column's value of the selected row
lngClientId = .TextMatrix(.Row, 0)
'here we assign the rows values to our array
For bytCount = 0 To UBound(strCustData, 1)
strCustData(bytCount) = .TextMatrix(.Row, bytCount + 1)
Next bytCount
End If
End With
'Now we call our next form where you want the selected row's data
' to be displayed
'Load the form
Call Load(frmUpdate)
With frmUpdate
'Then in frmUpdate create a Public Sub call MP_ClientDetails
'and here we call that Sub and pass through our array
'strCustData)
.MP_ClientDetails lngClientId, strCustData
.Show vbModal
End With
End Sub
'Here is the code for that Public Sub which should be in frmUpdate
Public Sub MP_ClientDetails(lngClientId As Long, strCustData() As String)
Dim bytCount As Byte
'Here we assign the values from our Array into the textboxes on
'frmUpdate (Obviously this could be changes to a grid or ??)
For bytCount = 0 To UBound(strCustData, 1)
txtCustDetails(bytCount).Text = strCustData(bytCount)
Next bytCount
End Sub
I really suck at explaining things but hope this helps a little.
If confusion reigns just tell me and I will try explain in a different way
Regards
Cliff
|
|
|
|
|
hi cliff
thank you for your help
it really work
thank you very much
|
|
|
|
|
Have a canvas 700 x 500.
Want to paste an image on it . My image can be smaller or bigger than the Canvas. Smaller image fits fine on the canvas...
But if I have an image larger than the canvas...how can I resize it without blurring the image??
I believe photoshop can reduce image size without blurring/squeshing the image..so, it reduces the image without messing it up...
Is this doable in .Net? Ca i resize/reduce an image to fit a 700x500 canvas without messing up how the image looks??
any ideas/sample code/website would be great to get me going...
|
|
|
|
|
I think all you need to do is set the InterpolationMode to Bicubic instead of Default.
Example:
e.Graphics.InterpolationMode = Drawing.Drawing2D.InterpolationMode.Bicubic
e.Graphics.DrawImage(bmpImage, destRect, srcRect, GraphicsUnit.Pixel)
Look up InterpolationMode in the help for all of the different modes.
To not know is bad.
To not wish to know is worse.
|
|
|
|
|
hmmm, I will... i didnt see InterpolationMode.Bicbic in Scott Mitchell's dicusstion but will look into it.
Thanks for the lead.
|
|
|
|
|
To simplify date conversion i was adviced to use to integer converted dates i.s.o. the datetime type.
Now i have the integer 37954 which resembles 01-12-2003 (dd-mm-yyyy)
select cast(37954 as datetime) as startdate
But VB6 thinks it is 29-11-2003
?Format(37954, "dd-mm-yyyy")
How is this possible? What am i doing wrong?
Grtz,
Guus
|
|
|
|
|
|
I don't have any Idea.
Sorry but it seems awkward to use integers for dates.
I think youd be better off using normal Date data.
or I suggest ask the one who adviced you.
Marvin N. Guerrero
- Casting More!!
|
|
|
|
|
In any format, dd-mm-yyyy or mm-dd-yyyy 73584 still means December 1st 2003. You have to retrieve the regional settings to get it right. That's why i use integers.
|
|
|
|
|
Have you tried storing dates as strings?
Easy to display in the format you want and easy to convert correctly to date/time format for any calculations that you need to perform on them.
Just be sure to confirm the value is a valid date before storing (use isdate() function)
Jon
|
|
|
|
|
Please give me details or the source code or atleast a logic to decode or analyse the FTP address or parameters from a packet sent through a network. I am doing a LAN sniffer.
|
|
|
|
|
I need some help... Is anyone aware of a product which can reverse engineer a dll-file, so I can understand what it does...
|
|
|
|
|
You are aware that reverse engineering is prohibited by the vast majority of license agreements.
However, if you are entitled to reverse engineer the DLL then it depends if it is a .NET DLL or a native DLL.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
|
|
|
|
|
Also, you'll get the not-so-easy-to-read assembly code for the .DLL, not C++ or VB...
RageInTheMachine9532
|
|
|
|
|
I created a usercontrol and it has a property that must be modified through a form. lets call the poperty MYpoints
The property is actually an array of points but rather than typing the values of the points I want to show a form.
The form will have a space on which I could draw a polygon.
clicking on a button ont the form will save the points of the polygon
into the Mypoints property.
Ei!! help me with this.
Thanks.
I'm getting dizzy with diz
Marvin N. Guerrero
- Casting More!!
|
|
|
|
|
You'll have to write a class that derives from UITypeEditor. Lookup UITypeEditor in VS Help to see an example.
RageInTheMachine9532
|
|
|
|
|
ei! thanks
I'll do just that!
just As I thought, The rage never sleeps.
Marvin N. Guerrero
- Casting More!!
|
|
|
|
|
I am having to bind objects from a database onto visual basic. I have already created the database connection, and the DataAdapter, and the dataSet. Now I am suppose to write code to bind them together. I am confused on how to even start. If I knew how to start then I would be able to do it. Do I need to (Filling a DataSet) also? Whoever can help, I would appreciate it?
Thank you,
ibok23
|
|
|
|
|
Use the .fill method of the dataAdapter at load time. Just follow this syntax, 'daInventory.Fill(dsInv1)' You may need to include the table name if there is more then one for your dataset. When your objects on the form are linked you will want to use a Binding ManagerBase to navigate. Then you will use the .Position to change the displayed values. This is all easier if you have some sample code. Is any of this familiar or is all this new? Would you like a code sample?
|
|
|
|
|
Unlike ADO, ADO.NET works in an unbound manner. No real dynamic connection to a database is provided.
use
* ADAPTERx.FILL(DATASETx.TABLES("tblname"))
to load data into the dataset DATASETx.
then
use
* Datagrid1.datasource = DATASETx.tables("tblname") <br />
to display the data in a grid.
use
* textbox1.datasource = DATASETx.tables("tblname") <br />
textbox1.datafield = "a_record_field"
to bind a textbox1
keep in mind the unlike in vb6 datagrid, the datagrid in VB.net is disconnected, the update method of the ADAPTER only executes a SQL command defined in the updatecommand object generated with you adapter. and it not always working.
Use the me.bindingcontext to manipulate binded controls!
its best done MANO a MANO!
-Marvin
Marvin N. Guerrero
- Casting More!!
|
|
|
|
|
I am very new at this. I am confused also. I have a book that is showing me what to do. But i am still confused. Yes, on a code sample.
Thank you,
ibok23
|
|
|
|
|
I have put together a sample which may help. You can download this from my FTP server. You can access by IP address which will change in time so don't wait too long to download. The files are in a folder called "RandysBoundControls Two Tables". It is about 1.7meg. This is a project I did for school. It should be fully functional. The database is in Access and is stored in the Bin folder. If you recreate the dataset, a .vb file will be rewritten and the lines of code I put there for setting a default value will no longer be there. This will cause an error when you add. Default values are needed for Dates(Date Time Picker) and check boxes (more notes are in the project). I suggest you make a copy. You can program bindings but I did the binding at design time. Look at the DataBindings section of properties for the text boxes. There is a text property there for binding textboxes.
The file is at FTP://4.10.187.76
|
|
|
|