choudhuryshouvi 33 Posting Pro

The Microsoft Windows Common Control 6.0 is already checked and I only got 1 Primary key each table. It is there in the zip. . .

the sample code that i gave you also contains one primary key in the database....so there is nothing wrong with the code or the database structure....this code is running absolutely ok in my system....the errors that you snapped in is completely system related....it is not related with your code....not logically or not in compilation level...

make sure that you have referenced "microsoft windows common control 6.0" and "microsoft windows common control 6.0 (sp3)" in your project->components list..

the reason for these errors are....this code uses two controls "datepicker" and "listview" which are included in "microsoft windows common control 6.0" and "microsoft windows common controls 6.0 (sp3)" components...so unless you register and add these into your project, the code won't compile....

i hope you understood the logic behind the errors now....so just do it and get me your feeds when you are done...

and ofcourse whether your table contains one primary key or more than one, that doesn't be a matter at all....coz according to your database this code was written in such a way that you won't face any problem in case if you accidentally inserts any duplicate value to primary key field...there is a validation for checking duplicate value already in the code....so just proceed with it....

regards
Shouvik

choudhuryshouvi 33 Posting Pro

did you register the activex components as I said...

if yes then goto project->components and check on "Microsoft Windows Common Control 6.0" and click ok....

nagatron commented: thank you so much friend for helping me =) +1
choudhuryshouvi 33 Posting Pro

okk......check out this code now...
i think this time it is 100% OK...

regards
Shouvik

choudhuryshouvi 33 Posting Pro

hallo friend, I have tried your code about the case sensetivity. I works great but there's a little bit problem. If I input like this:

Input1:
Event Name: Fieldtrip --------------------> (primary key)
User: Neil
Schedule: 1/20/09

Input2:
Event Name: Tour --------------------> (primary key)
User: Neil
Schedule: 1/20/09

Where the event name is my primary key in the database. It results an error if "User" and "Schedule" in input1 and input2 are the same. I was expecting that there will be no error coz my primary key is "Event Name" not the user or schedule. "some error occured..." this message will appear. But if I input another entry in input2 like:

Input2:
Event Name: Tour --------------------> (primary key)
User: James
Schedule: 1/21/09

This works fine.

can you upload your database(only) here...so that i can investigate.....according to the code...there is not a single line of error at all....i have tested it several times....but i tested it with a sample database....ofcourse your db structure is 100% diff. than this...so if you give me the actual database i can check for the error more thoroughly........now the choice is yours...

btw thanks for using the code and for urs feedback...

regards
Shouvik

choudhuryshouvi 33 Posting Pro

These are the errors I see in the sample you sent to me. I was not able to view the running part. =) I will try to understand your code.

what did you mean by this --->

I was not able to view the running part

did u mess up with vb???....it seems that some of your activex files (.ocx) are missing.....the snaps that you are attached are fully system related....these are not related to the program at all....to avoid getting this error you have the following options :-

1. uninstall and then re-install vb
2. just register "mscomctl.ocx" and "mscomct2.ocx" in your system...
might be you are not familer with registering activex controls manually...so i'm giving you the steps :-

1. if you haven't yet messed up with vb, you will have these two ocx files in your "system32" directory of your root drive..
2. use the command --> regsvr32 <ocx file name> to register the files...like to register "mscomctl.ocx" you must type....

regsvr32 mscomctl.ocx....similarly....for the other one
regsvr32 mscomct2.ocx..........issue this command from start->run

just register these two ocx files and the errors will be simultaneously solved....

if you donot have these files...just download from net....these are freely distributable and available for download...

regards
Shouvik

choudhuryshouvi 33 Posting Pro

Hello.......i have attached the sample code...
just check this out....and get me your feedback...

hope this will be useful for you...

regards
Shouvik

choudhuryshouvi 33 Posting Pro

you have done some mistakes in the code....do the modifications as I mentioned...

in the function definition change

rst.Open "select * from event where eventname='" & [B]Trim(txtEName)[/B] & "'", gcn

to the following ...

rst.Open "select * from event where eventname='" & [B]Trim(evtName)[/B] & "'", gcn

in your cmdAdd_click() change the entire code...like the following...

Private Sub cmdAdd_Click()
dim rst as New ADODB.Recordset

on error goto chec

If IsEventExists(txtEName.Text) = True Then
    MsgBox "Event Name Already Exist. Type a new one", vbInformation, "Duplicate Event"
    txtEName.SetFocus
    exit sub
endif	

rst.CursorLocation = adUseClient
rst.CursorType = adOpenDynamic
rst.LockType = adLockOptimistic

if rst.state=adstateopen then  rst.close
set rst=nothing

rst.open "select * from event",con,1,2
rst.AddNew

rst!fnumber = StrConv(txtFNumber, vbProperCase)
rst!eventname = StrConv(txtEName, vbProperCase)
rst!fname = StrConv(txtFName, vbProperCase)
rst!fincharge = StrConv(txtFIncharge, vbProperCase)
rst!fschedules = StrConv(Text2, vbProperCase)
rst!fschedulee = StrConv(Text3, vbProperCase)
rst!sitcapacity = StrConv(txtCapacity, vbProperCase)
rst!userschede = StrConv(Combo4, vbProperCase)
rst!userscheds = StrConv(Combo3, vbProperCase)
rst!fuser = StrConv(txtFUser, vbProperCase)
rst!destination = StrConv(txtDestination, vbProperCase)
rst!condition = StrConv(cboCondition, vbProperCase)
rst!enddate = dtpDate(0).Value
rst!startdate = dtpDate(0).Value
rst!transaction = StrConv(cboTransaction, vbProperCase)
rst!fsh = StrConv(txtfsh, vbProperCase)
rst!ush = StrConv(txtush, vbProperCase)

rst.Update
if rst.state=adstateopen then  rst.close
set rst=nothing

Label20.Caption = "Successfully Saved. . ."
Call dload2

exit sub

chec:
err.clear
msgbox "some error occured..."
txtEName.SetFocus
exit sub	
End Sub

try this and get me your feed...

regards
Shouvik

choudhuryshouvi 33 Posting Pro

If the name already exits in the database, the message "Event Name Already Exist. Type a new one" will supposedly appear. But it only works if I input "Neil" but if I input "neil" or "NEIL", error message appear, "you can't store item because it's already exist in the database" then the 3 buttons appear "end, debug and the 3rd one (i forgot the name) will appear. What do you think is wrong with the code? Why is it this message (Event Name Already Exist. Type a new one) will not appear if I input the same name but with different letter case?

All I want is no matter what case you use, the message "Event Name Already Exist. Type a new one" should appear if it exist in the database. . .help me, thank you so much.

well....frnd...msaccess doesn't care for case at all....whether you use uppercase or lowercase or mixmatched letters....msaccess recognizes all as same....but to avoid getting this error you can modify your code....just a sample here....you can check this out...

just write a private function with return type of boolean, pass the event name which you need to check for duplication as parameter

now on a button_click event, accept an event name from a textbox, call the function and if it returns true then show your msg....that's it....so simple...

Private Function IsEventExists(ByVal evtName As String) As Boolean
Dim gcn As New ADODB.Connection
Dim rs As New ADODB.Recordset

On Error GoTo err1

If gcn.State …
choudhuryshouvi 33 Posting Pro

what's the exact error msg you are getting????
can you be more clear on this....

choudhuryshouvi 33 Posting Pro
choudhuryshouvi 33 Posting Pro

i don't know what exactly u r doing. but everything is working fine on my node. just change the syntax from baseurl like :-

mediaplayer1.filename="http://www.voanews.com/wm/voa/europe/alba/alba1700vb.asx"
mediaplayer1.play

and make a settings in properties window :-

showstatusbar=true

then run the code and hit the play button and u'll notice some actions in the status bar of the player. it will first contact with the server,then search for the codecs and install them into ur computer. after this buffering will start and here you go....BINGO!!!!

lets just do this and rply me.

regards
shouvik

choudhuryshouvi 33 Posting Pro

it can have possible three reasons :-

1. the msdxm.ocx module is not present in ur OS system directory.

2. your vs2005 software is opened and u hv a form where u have inserted an instance of the msdxm.ocx component.

3. if u r using windows vista then the above command regsvr32 won't work. it will only work less than vista versions.


check whether either of these is happening.

regards
shouvik

choudhuryshouvi 33 Posting Pro

btw what about u Sonia??? r u too busy now so u r not making enough time to post replies.

why some one else is posting here on behalf of u!!!

choudhuryshouvi 33 Posting Pro

usually vb.net does not support any com components like the .ocx files we all use in vb6 apps. so whenever u need to use these files after adding the same from "choose toolbox items" dialog box, always the register it using the windows registry server utility. u can use the following command :-

regsvr32 <com component name/.ocx file name>
e.g. regsvr32 msdxm.ocx
(pass this command to register the above mentioned component)

u can pass this command from start->run

P.S. the .ocx files that ur machine has all installed in system32 directory of ur OS.

regards
shouvik

choudhuryshouvi 33 Posting Pro

instead of using wmp.dll try using msdxm.ocx.
you can include it from com components tab.
just right click-->toolbox-->select choose new item...and browse msdxm.ocx from system32 folder and click ok to add it.

make sure you have registered the component using regsvr32 utility.

regards
shouvik

choudhuryshouvi 33 Posting Pro

hello zawpai.......
have you benefited from the code i gave you?
is this what you wanted?
has it solved your problem?
did you get your answer?

if your answer to all the questions is YES then mark this thread as SOLVED.

well.......if you still want any more help just do not hesitate.....post right here..

regards
Shouvik

choudhuryshouvi 33 Posting Pro

hello zawpai......look in the attachment.
there is a code for you showing how to read and write using windows registry.

when you run the code the login form opens and it will ask you to enter new username & password. enter those and click save. next time you run the program you can login using the previously stored info. well this is just a sample snippet. this is not all. this code can be made more advanced and secure based on program requirement.

check this out and give me your feedback. if you got any questions ask me here.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

why .dat or .txt file?

whats wrong in storing the login info in database?

after all they are sensitive info and storing them in a normal file in textual format can lead other users to easily view or modify them.

even storing the passwords in registry can be a good option. just make sure that you have taken sufficient caution before making your move to play with your os.

choudhuryshouvi 33 Posting Pro

i'm getting a run time error "Run-time Error'3265' Item cannot be found in the collection to the requested name or ordinal" Its corresponding with this code

Set tempRecordSet = AdoClerk.Recordset("select * from Clerk where UCase(trim(ClerkId)) = '" & UCase(Trim(txtClerkId)) & "'")

your sql query is invalid. in your query the usage of "UCase" and "Trim" functions are invalid. They are vb6 library functions. so they won't be recognized by your ado data control and cannot be converted into sql commands. rectify the statement like this,

select * from Clerk where upper(ClerkId)='" & ucase(trim(txtClerkId.text)) & "'"

one more thing, which database you are using? try the above syntax if you are using sql server or oracle database. but if you are having an ms-access database the above syntax won't work because there is no upper() in access library. access doesn't care whether you type uppercase or lowercase characters. in that case use like this,

select * from Clerk where ClerkId='" & trim(txtClerkId.text) & "'"

Am I using the wrong code for use with a ado control???

well, you can have two answers in this context. if you use ado data control then there is nothing wrong with your code. but it is always recommended that you donot use any data bound control. instead of it use ADODB (Microsoft ActiveX Data Objects Library) objects and methods to communicate with your database. it becomes more easy and secure and gives you lots of advanced functionality. now the decision completely depends on …

choudhuryshouvi 33 Posting Pro

i am having an error with the password.

what problem are you facing with your password?
what is the error?

plz explain...

choudhuryshouvi 33 Posting Pro

use like this :-

Private Sub Command1_Click()
Dim a, b As Integer
a = 10
b = 20
[B]Call sum1(a,b)[/B]
End Sub

regards
Shouvik

choudhuryshouvi 33 Posting Pro

why this question is raising?

"If u don't want to reply then its's OK."

i think there must be a misunderstanding. i just said you that not only me others can also give you valuable replies. there is no such problem that i don't want to reply you.
its my pleasure to reply you too...

i told that because due to the language you have used in your reply other members can get hurt from it or there a misunderstanding among the members can arise. personally i don't want that to be happened. so that's why i told you that.. hope you will understand...
so don't think like that any more...

ok..

regards
Shouvik

choudhuryshouvi 33 Posting Pro

why are you asking like that?

not only me there are so many experts are here. apart from me they can also give you proper suggestions.

ok... check in your other thread.
i have given a sample code there.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

ya you got me right

choudhuryshouvi 33 Posting Pro

thanks buddy
i didn't ever try to underestimate your code.
that's a great one too.

i just tried to show thats there is an alternate solution too.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

and one more thing my frnd, if you got your answer then please mark this thread as solved. this will help other perople to easily find solved threads which signifies a definite solution to their problem having same doubts like you.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

you r welcome.
just ask us whenever you stucked..

bye.

choudhuryshouvi 33 Posting Pro

i wanna to get size of file.
help me how to get this. anyone know how to do this.
any help will be appreciated :)

this is a simple but efficient code..

Dim fln,result
Dim fname as String

fname="c:\windows\regedit.exe"

fln = FileLen(trim(fname))
result = CInt((fln / 1024) / 1024) & " MB" & "(" & fln & " BYTES)"

Msgbox "FileSize is -->" & result

you will display a message box containing this text :-

FileSize is --> 9 MB(9016447 BYTES)

hope this helps you.

regards
Shouvik

dnk commented: much efficient :) +1
choudhuryshouvi 33 Posting Pro

see the answers in inline...

Function return type by default is integer in C. & if we do the same prog in C,it returns 3 not 3.333333....But in VB the function return type is Variant????Right or Wrong?

yes its right

variant is data type which can hold the data of any type like integer,string,double...Right or wrong?

yes its right again

I want that the fn. return can integer value only by default, if we write
Private Function div(a, b) as double

only then it returns decimal value??

Plz reply frnds.:(

Just a little modification in your code and you will get exactly what you want..

Private Function div(byval a as integer,byval b as integer)as integer
div = a / b
End Function

or you can try this also...

Private Function div(byval a as integer,byval b as integer)
div = a / b
div=Cint(div)
End Function

hope this helps..

regards
Shouvik

choudhuryshouvi 33 Posting Pro

did you read my previous reply?

i think you didn't. that's why you are asking the same question again n again...

combining menu items from diff. parent menu cannot be possible. to show these menu4 and menu5 together in runtime you must create them under the same menu head.

hope you will notice now...

regards
Shouvik

choudhuryshouvi 33 Posting Pro

Hi...
i want to make flash window...
after program completed something task then that window will flash.
i ask my friend and he said to use api function. but i don't have an idea to do this.
please help me masters...

any help will be appreciated.

best regard
Jade

here is a sample snippet for you. try it. just place a command button and a timer on your form for testing. set an interval for the timer. for ideal experience set it to 1000.

give me a feedback after you try this code.

Option Explicit

Private Declare Function FlashWindow Lib "user32" (ByVal hWnd As Long, _
ByVal bInvert As Long) As Long

Private Sub Command1_Click()
Timer1.Enabled = True
End Sub

Private Sub Form_Load()
Timer1.Enabled = False
End Sub

Private Sub Timer1_Timer()
FlashWindow Me.hWnd, True
End Sub

hope this will help you.

regards
Shouvik

Jade_me commented: Great Code :) +1
choudhuryshouvi 33 Posting Pro

the menu items that you create for your form can be visible in run mode only. when you right click on your form in the designer you will show vb6's system submenus.

as far as i know combination of menu items is not possible. in order to show the items fillcolor and small you must add them under the same menu. but might be some way using some APIs. try searching in google or into the following site :-
http://msdn.microsoft.com

regards
Shouvik

choudhuryshouvi 33 Posting Pro

what have you meant by printer properties?

plz explain in detail.

or you can try this :-

add the component Microsoft Common Dialog Control 6.0 from Project->Components.
make an instance of it on your form.
now take a comman button and place this code,

Private Sub Command1_Click()
[B]CommonDialog1.ShowPrinter[/B]
End Sub

It will show you the windows Print dialog box (the same one which you might be seen when trying to print documents from external windows applications like Notepad,wordpad,etc.

using API becomes more advance technique. you can API to access printer properties and configure it right through your code like finding its driver, setting up proper port, sending print commands,etc.,etc. For API reference Visit This Link.

regards
Shouvik

Sawamura commented: great help :) +1
Naruse commented: simple and nice +1
choudhuryshouvi 33 Posting Pro

first of all there is no crystal report control available with crystal report 11 library. you have to use the new one crystal report viewer to fire up your reports from your vb6 application.

to use the crystal report viewer in your project, you need to make a full installation of crystal report 11.0 software. only copying the activex component to your system directory will not do the job.

after installing the software goto project->componets and there you will found crystal report viewer control. add this to your project.

now for the coding purpose, you should know the syntax for firing a report in crystal report 11 is completely diff. than its earlier versions. as it is built to support .net framework it doesn't support previous methods/properties of the previous crstl32.ocx any more. to get some sample coding make searching in google. you will easily find some.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

you are welcome my frnd.
now if you got solution to your question completely then plz mark this thread as solved.

choudhuryshouvi 33 Posting Pro

did you read my previous reply thoroughly?

i checked the zip file and what i found is you have modified the code and you did it in wrong way. check my previous reply, there i already said don't include any file name in the textbox where you are typing the path , i.e., don't type like D:\Import\mstfile.csv. just type the path only i.e., D:\Import. the code will fetch all csv files located in the folder.

and the other one is ,
delete this line csv_path = "D:\import\mst.csv"
inside the function GetCSVFiles.

i hope this should now solve your problem.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

ok andy, i think the following code is the complete solution for your question. just place a textbox, a button and a listbox on your form for testing. some changes i have made here over your logic and they are :-

1. you don't need to fix the location of the data folder. this code will create the data folder automatically in the same location from where the csv files are taken.
2. just type a valid path in the textbox and click the button to execute the code. for example, as you have given the path just type D:\Temp\Database in the textbox and click the button. don't mention any filename in the path. this code will automatically extract all csv stored inside this folder for you. if everything goes well you will be notified by a msg which is "Extraction complete."

plz give me a feedback here.

Option Explicit

Dim source_path As String

''this function will fetch all csv files stored inside the directory specified in csv_path variable ''as a parameter and add them in a listbox
[B]Public Function GetCSVFiles(ByVal csv_path As String) As Boolean[/B]
Dim FileName As String, ext As String, pos As Integer, i As Integer

On Error GoTo load_error

If Right(csv_path, 1) <> "\" Then
    csv_path = csv_path & "\"
Else
    csv_path = csv_path
End If

If Dir(Trim(csv_path)) = "" Then
    GetCSVFiles = False
    Exit Function
End If

source_path = csv_path
FileName = csv_path & "*.*"

Do Until FileName = ""
    For …
choudhuryshouvi 33 Posting Pro

ok now i understood what you wish to do.
that's not a big issue to solve.
i'll post the code here.

just tell me one thing,
will the csv files be located in the application folder always or might it be stored in other locations also?

there is no need to use the timer control. u can easily fetch all csv files located inside a directory and create an array of those. then running a loop, taking an element from the array one by one, parsing data and creating the text file will do the job.

choudhuryshouvi 33 Posting Pro

hi andy,

as far as I see from ur attachment,
you r accepting path of a .csv file and then clicking on import, create a data folder in ur application path and then creating a separate tect file for each rows presented in the csv file.

ok as i read in ur post you want an automated process and this is exactly what is going on in ur existing project.

so what else now u r expecting to do from us?

choudhuryshouvi 33 Posting Pro

Hello,
I need to a browse button to be able to open an image in the image control and also be able to get the path for the image...
Can anyone help...

Check out this sample project. look the screenshot also.
and tell me what do you think about it.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

VB.Net is the newer enhancements for the visual basic language. the main vb language came in 1994 and it was included as a member of a software toolkit named "Microsoft Visual Studio 6.0". this version of visual studio also had some other languages like "Visual Foxpro", "Visual Interdev" which are dead now. among from these visual interdev was used to build web based applications using visual basic as the standalone language. now microsoft has released the modern version of VS and also newer technology to build web solutions which is known as ASP.Net.

practically you can apply your knowledge in .net version of vb also. but there are so many changes happened there over vb6. vb6 was object based language but now in .net platform visual basic has been enhanced as a full fledge object oriented programming language. so it offers more practical OOP concepts over vb6. we can apply core concepts of OOP like abstraction,encapsulation, polimorphism and inheritance in vb.net more easily and it maintains the OOP standards. with vb6 we can also do such things but there did not maintain the OOP standards. as .net platform is running on CLR so there is more flexibility in writing programs because you can use more than one programming language under a single environment.

but for beginners starting with vb.net is not so good option. you should start your programming experience in vb6 and then apply your knowledges in vb.net to enhance it. …

choudhuryshouvi 33 Posting Pro

though this is not the correct forum to describe on this matter but anyways here is your answer.

you are attempting implicit datatype conversions or more frankly type casting which is invalid in this context. coz you can't store a text or string value directly to an numeric variable. before doing it make proper type casting like convert string to numbers or numbers to string/characters.

change your code as this :-

pagoHora = Integer.parse(trim(txtPagoPorHora.Text))

OR,

pagoHora = val(trim(txtPagoPorHora.Text))

as I can see in your posted code you will again face the same error in the next line also. as horas is an integer variable and you are putting a string value to it. this cannot be done. make proper casting before doing that.

and one more thing my frnd, always check for the right forum before you post your question. this will help you to find or get your answer more quickly and easily. this forum is visual basic 6 and older versions.
For any further post that you might make plz goto Visual Basic.Net Forum.

with best regards
Shouvik

choudhuryshouvi 33 Posting Pro

If I was not wrong the term should be "Download" instead of "Upload".

Check out this sample code, There you will find some syntax on how to add data from msflexgrid to database.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

many many thanks to all. thistime shuvi's code works well. thx again shuvi.

glad to hear that. but cometburn's syntax is also correct. you can apply that also.
(completely upto you).

ok....
if u got your answer then mark this thread solved.

regards
Shouvik

choudhuryshouvi 33 Posting Pro

glad to help you out.

if you have got ur answer then mark this thread solved.

ok......
bye

choudhuryshouvi 33 Posting Pro

one thing you can do. just put a if condition inside your validate event before the code for checking existence of the textbox's value. check if the textbox has null value in it or not. if it don't then fire the code else just exit the sub. like this :-

private sub text1_validate()
if trim(text1.text)<>"" then
   <your code for checking into database>
else  <as the textbox is empty, so there is no need to check for the code into the database
    exit sub
end if
end sub

regards
Shouvik

choudhuryshouvi 33 Posting Pro

Dim TaskID As Long
TaskID = Shell(App.Path \ CAIsetup.exe, vbNormalFocus)

=====================

what extension shall i used???

there is no problem with the extension. your setup package is of course an self-executable file and like other exes' it also has an extension .exe . there is a mistake in your syntax.
try this out.

Shell(App.Path & "\CAIsetup.exe", vbNormalFocus)

else you can use an windows api function to execute this.

API Implementation :-
declare this api function at general section into your form :-
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

and this is your code :-
ShellExecute Me.hwnd, "Open",App.Path & "\CAIsetup.exe" , vbnullstring, vbnullstring, vbNormalFocus


think this helps.

regards
Shouvik

hawisme000 commented: thx again n again!! +1
choudhuryshouvi 33 Posting Pro

Hello,

I have a combobox on my form that I need to be populated with data from a table in MS Access. I am new to coding in Visual c# and would appreciate any help I can get with this.

Thanks in advance,

SubProf

Though this is not the right forum to reply but probably the following code should your answer. Follow it.

using system.data

oledb.oldedbconnection con;
string sql;
dataset ds=new dataset();
oledb.oledbDataAdaptar da;
int maxrows=0,i=0;

con=new oledb.oldedbconnection();
con.connectionstring="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\STUDENT.MDB;Persist Security Info=False";
con.open();

sql="select name from information order by rollno";
da=new oledb.oledbDataAdaptar(sql,con);
da.fill(ds,"Information");

maxrows=ds.tables("Information").Rows.Count();

dropdownlist1.items.clear

for(;i<=maxrows-1;i++)
{
  dropdownlist1.items.add ds.tables("Information").Rows(i).Item("Name");
}

regards
Shouvik

choudhuryshouvi 33 Posting Pro

you don't need to get the ascii code of TAB to trap the key. just put your code inside the VALIDATE or LOSTFOCUS event of ur textbox. whenever you press the tab key the code will be automatically fired.

choudhuryshouvi 33 Posting Pro

as debasisdas said,

dim ctlcontrol as object
dim fn as string,fsize as integer

fn="comic sans ms"
fsize=10

on error goto font_mistake

for each ctlcontrol in form1.controls
   ctlcontrol.font=fn
   ctlcontrol.fontsize=fsize
next

exit sub

font_mistake:
   err.clear
   resume next

hope u'll grab some idea.

regards
Shouvik