|
moore20
|
lucky please how do i link 2 combo boxes to display states and their local government just like what we see in most forms where u select state of origin from the first combo and then it displays a list of all the local governments in that state
abeg i need your help
thanks a million
|
|
|
|
|
|
luckyCO
|
U will have list of all the states and their corresponding localgovernments.\ Say In FCT we have FCT Index no is 6 In your database you will have all these fields
StateID LGAName
LIst StateID LGANAME 6 AMAC 6 BWARI 6 KWALI 6 ect
Then you goto you the combo1_Click event and write the following SQL statement
Select LGANAME from LGAtbl where STATEID=" & val(cboSTATEID.text) Then insert in in your combo
If you need me to write the program for I will be happily do tht free of charge for you because it requires more procedures than this.
Thanks. Text me on 08036025235
|
|
|
|
|
|
dami9ja (m)
|
@luckyc0, Great wrk u d0in here sir! I need your help on this little thing. I jst re-started Vb n i created a simple result sheet which displays "grades","total" n "average" after some values are entered in the different "marks" boxes. What i need now is a way to count n display d numbers of of "fails" in d "grade" txtboxes i.e. If 2 courses are failed it shud display 2,if tis 3 it shud dsplay 3 n so on. Hope i wuz able 2 explain smethng. Thanks bro,
|
|
|
|
|
|
dami9ja (m)
|
@luckyc0, Also need some advice from u. Plz give me your Yim id so we can tlk beta. Thanks. Myn is dammiedam.
|
|
|
|
|
|
moore20
|
hi lucky sorry to bother u again please how do i connect a vb project to a database(access) using ADODB connection please start from project----reference or component e.t.c
keep up the good work u r blessed,
|
|
|
|
|
|
luckyCO
|
hi lucky sorry to bother u again please how do i connect a vb project to a database(access) using ADODB connection please start from project----reference or component e.t.c
keep up the good work u r blessed,
I don't like when somebody is feeling sorry for what he has been given right to do. I have posted answer to this question but for the sake of not knowing the thread am posting it again. To connect to database(access) using ADODB connection follow the steps; 1. Click at Project Menu , from its sub menu click References. 2. that will take you to a window, search and Check Microsoft Ado Ext. 2.8 For DLL and Security,Microsoft ActiveX data Objects 2.0 Library and Microsoft ActiveX data Record set 2.0 Library. 3. Click Ok Button 4. Open a form and command button. 5. Copy the code below and paste in the form declaration Sub OpenD3(ConnString As String, SQL As String) As ADODB.Recordset Dim dbw As New ADODB.Recordset dbw.ActiveConnection = ConnString dbw.Source = SQL dbw.CursorType = adOpenKeyset dbw.LockType = adLockOptimistic dbw.Open Set OpenD3 = dbw End sub 6. Double click Command button and paste the code below Dim rs New ADODB.Recordset set rs=OPend3(your connection string,SQL) the do whatever you want with the recordet. Thanks @luckyc0, Also need some advice from u. Plz give me your Yim id so we can tlk beta. Thanks. Myn is dammiedam.
@luckyc0, Great wrk u d0in here sir! I need your help on this little thing. I jst re-started Vb n i created a simple result sheet which displays "grades","total" n "average" after some values are entered in the different "marks" boxes. What i need now is a way to count n display d numbers of of "fails" in d "grade" txtboxes i.e. If 2 courses are failed it should display 2,if tis 3 it should dsplay 3 n so on. Hope i wuz able 2 explain smethng. Thanks bro,
If you were able to display those that failed in textboxes Now use this code down and iterated and sum them. dim txt as control dim sum=0 For each txt in me if typeof txt is textbox then if txt.text="fail" then sum=sum+1 end if next @luckyc0, Also need some advice from u. Plz give me your Yim id so we can tlk beta. Thanks. Myn is dammiedam.
cyprosoft
|
|
|
|
|
|
dami9ja (m)
|
Dont quite undastand d solution you gave. Plz kindly hlp me add sme comments for better clarity. Thanks sir. @LuckyC0
|
|
|
|
|
|
luckyCO
|
Please say exaclty what you want me to comment for. Or later, Send the uncompleted program for on my mail I will complete it for you and send it back to you with comments.
Thanks
|
|
|
|
|
|
moore20
|
thanks lucky i really appreciate your assistance in VB 6 so far but i would be glad if u can still teach me c++ probably with an e-book to study guess you are good at it too, i'll be xpecting your respose thanks and continue the good work
god bless u.
|
|
|
|
|
|
dami9ja (m)
|
0h! I finally got it after some reading,u know am stil a beginner! Thanks 1ce again sir.
|
|
|
|
|
|
luckyCO
|
thanks lucky i really appreciate your assistance in VB 6 so far but i would be glad if u can still teach me c++ probably with an e-book to study guess you are good at it too, i'll be xpecting your respose thanks and continue the good work
god bless u.
Sorry I dont know C++ much. Am a microsoft person,if you have problem in vb.net or C# i can equally help but not c++ Thanks
|
|
|
|
|
|
RuuDie (m)
|
 |
Re:
« #171 on: November 09, 2008, 12:19 PM » |
|
@ all who can help,
with respect 2 dynasty's problem of "filtering & selecting unique records randomly." how can the values of the arrays be stored into a new word or excel sheet & saved with a specified name.
|
|
|
|
|
|
luckyCO
|
I will write the program and sent it to. Am not working with my system so cant do that. Please check back. Thanks
|
|
|
|
|
|
luckyCO
|
'Open a project on its from clear and paste the code below. Thanks
Dim g(100) As String Dim SQL As String Private Sub Form_Load() Dim J As Integer For J = 0 To 99 g(J) = J + 1 & " good work" SQL = SQL & J + 1 & " good work" & vbCrLf
Next
Print2Excel
End Sub Public Sub Print2Excel()
On Error GoTo errh Dim D As Object, K As Long, J As Long Set D = CreateObject("Excel.Application") D.Visible = True D.Workbooks.Add Dim II As Long Dim i9 As Long
D.Worksheets.Add
Dim M As Long
For K = 0 To 99
D.Worksheets(1).Cells(K + 1, 1) = g(K) Next K
D.Worksheets(1).Columns.Font.Size = 8 D.Worksheets(1).Rows(1).Font.Bold = True D.Worksheets(1).Rows.AutoFit D.Worksheets(1).Columns.AutoFit Exit Sub errh:
End Sub
|
|
|
|
|
|
faoni572 (m)
|
Pls how can I make MSHFlexgrid to adjust automatically to the longest length of the text that enter it. The data may come from database and I want a way the grids will stretch automatically when I dispaly it instead of adjusting the columns manually to read the text.
|
|
|
|
|
|
zedon
|
does anyone know how to block my computer from asking for my dads administrator password any time i wnt to download on the computer
|
|
|
|
|
|
moore20
|
hi lucky how are u? you said you could help me write a program connecting 2 combo boxes to display states and their local governments i would really appreciate it if u send the program my e-mail id:moore501@yahoo.com
thumbs up mann,
thanks
|
|
|
|
|
|
luckyCO
|
hi lucky how are u? you said you could help me write a program connecting 2 combo boxes to display states and their local governments i would really appreciate it if u send the program my e-mail id:moore501@yahoo.com
thumbs up mann,
thanks
I will attend to you by God Grace. I have taken note of your program, I will write it and send to you. please how can I make MSHFlexgrid to adjust automatically to the longest length of the text that enter it. The data may come from database and I want a way the grids will stretch automatically when I dispaly it instead of adjusting the columns manually to read the text.
I dont think I have done something like dat using flexgrid. I used to do that in dotnet. But will look at it and possibly write a program thatwill do that
|
|
|
|
|
|
faoni572 (m)
|
@ luckyCO, I saw the code to make flexigrid adjust automatically according to the text that enter it, I saw it on the net, I am not the one that write it but it works very fine for me without any error. I copied the code below for you to see it.
Thanks a lot.
'xxxxxxFlexigrid Adjust to the lenght of Data xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxx MSHFlexGrid1.AllowUserResizing = flexResizeBoth
Dim r As Integer Dim c As Integer Dim max_len As Single Dim new_len As Single Font.Name = MSHFlexGrid1.Font.Name Font.Size = MSHFlexGrid1.Font.Size For c = 0 To MSHFlexGrid1.Cols - 1 max_len = 0 For r = 0 To MSHFlexGrid1.Rows - 1 new_len = TextWidth(MSHFlexGrid1.TextMatrix(r, c)) If max_len < new_len Then max_len = new_len Next r MSHFlexGrid1.ColWidth(c) = max_len + 240 MSHFlexGrid1.ColAlignment(c) = flexAlignLeftCenter Next c
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxx
|
|
|
|
|
|
|
|
smallboy2
|
For Undergraduates who need programing projects we have great programers who will help you. You can also reward luckyCO for his good work here.
|
|
|
|
|
|
|
|
*dhtml (m)
|
@lucky, great job u are doing here - u have really challenged me - my vb 6.0 is rusty - and vb 6.0 was the first lang i learnt to speak 10 years ago! I am going to start another thread on vb 6.0 something related to web design - and i will love you to fall in once in a while - it is obvious that you are far better than me in vb 6.0 programming - no be beans talk - and i alwayz like to give respect to ppl better than me!
I specialize in an area of vb that is directly related to web development, but my core vb is not quite as sharp as yours from what i can see in your posts.
Great Job helping your students - i like that part too.
|
|
|
|
|
|
Lisa11
|
Before reading your article I don't have any idea about this . Thank's for giving me knowledge about a new thing. Lisa11 Online Dating
|
|
|
|
|
|
Stan Iyke (m)
|
in vb, when your access database gets full, how do u connect d new one u create to d old that gets fiiled up, besides, if u want to generate pins, dat u av stored already, wat will be d codes. for example, if u want to give out pins to different users. plz, gimme your numbs so i can kal u.
|
|
|
|
|
|
luckyCO
|
in vb, when your access database gets full, how do u connect d new one u create to d old that gets fiiled up, besides, if u want to generate pins, that u av stored already, what will be d codes. for example, if u want to give out pins to different users. plz, gimme your numbs so i can kal u.
Well you can create an interface where user can create database and another interface where they can switch from one database to another. I don understand your second question about PIN and Code. 08036025235 Cy
|
|
|
|
|
|
Stan Iyke (m)
|
Tanx bro. Plz how do i create d interface to switch rm one datbase 2 anoda or an interfaze 2 create an intafaze. Plz i aw8 your rply. God bles. As 4 d pin, iv sortd it out wt i usd ws randomize timer, 2 generate d pins witout repitetion. But it generates pin one afta d oda. Plz, if i want say 200 pins 2 b generatd at once, how do i go abt it. Aw8 your rply. Shalom!
|
|
|
|
|
|
twumie (m)
|
How can you add a database to your program on VB 6
|
|
|
|
|
|
Stan Iyke (m)
|
Dependin on d type of dbase, u wnt 2 use. Access or mysql. 4 access, g2 ms acess n create d name nd d table name. Use adodc 2 link it.
|
|
|
|
|
|
Stan Iyke (m)
|
Plz lucky ow do i create an interface 4 users 2 create database. Plz im usin access, cuz i jst strtd mysql. I aw8 your rply. Nyt nyt.
|
|
|
|
|
|
luckyCO
|
Tanx bro. Plz how do i create d interface to switch rm one datbase 2 anoda or an interfaze 2 create an intafaze. Plz i aw8 your rply. God bles. As 4 d pin, iv sortd it out wt i usd ws randomize timer, 2 generate d pins witout repitetion. But it generates pin one afta d oda. Plz, if i want say 200 pins 2 b generatd at once, how do i go abt it. Aw8 your rply. Shalom!
How to create an interface to switch from one database to the has to go this way 1. Your database information must be out, meaning that you get your database information from a registry or text file (Text file recommended) 2. Create a vb form and code into it to be able to retrieve all the existing database and allow you to have another text file. cbodbname.clear 'a combox where you fill all your existing db name. cbodbstatus.clear 'a combox where you fill all your existing database status will be filled whether active or not. At most one database will be active. dim dbnamedb as string dim activedb as string Open App.Path & "\databasename.txt" For Input As #1 do while not eof(1) Input #1, dbnamedb,activedb cbodbname.additem(dbnamedb ) cbodbstatus.additem(activedb) loop close Cause the user to select the database he/she want after which he clicks at a command button embed the code blow your command button sub procedure Open App.Path & "\databasename.txt" For Output As #1 dim J as integer dim dbn as string dim dbS as string for J=0 to cbodbname.listcount-1 dbn=cbodbname.list(j) if j=cbodbname.listindex then dbS ="1" else dbS ="0" end if Write #1, dbn,dbs next j close 3. Create another form to allow you create your database and save a copy of that database name in your text file. Look for code to create access database. Open App.Path & "\databasename.txt" For Output As #1 Write #1, txtdbname.text,"0" close 4. cause your program to go an read the active database from your text file. public Databasename as string Open App.Path & "\databasename.txt" For Input As #1 do while not eof(1) Input #1, dbnamedb,activedb Databasename =dbnamedb ' incase if no database is active if trim(activedb)="1" then Databasename =dbnamedb exit do close end if loop close If you didnt understabd the code and what u want to do with this code is very important to yuo, i can mapp out time design only this area and post it here. Take care and remain blessed
|
|
|
|
|
|
luckyCO
|
How can you add a database to your program on VB 6
You can do by having a little know abt a particular database say Access,mysql etc You should be able to know hw to create table in any then you now learn how use SQL statment to access data from your database. We have so many ANSII SQL which is available for almost all databasein the world although Oracle is trying to create its SQL but it still allows some ASNII. so when u know that you are in biz with vb6.0 we ve some commands like Select Delete update Truncate Create Drop etc So learn the esp Select,update,Delete and when to use them If u ve no idea about this let me know i will send something to u that will help u out.
|
|
|
|
|
|