vb5prgrmr 143 Posting Virtuoso

Unfortuantly, as CRMatthews pointed out Sleep will lock up the entire application but what they did not say is that if done for a long enough time, the application will become unresponsive in task manager and any kind of attempts by the user to interact with the program will only frustrate the user.

While a doevents loop with sleep is certainly one way to have your application pause for a few minutes, you idea of a timer "MAY" be a better solution. Lets say you want your program to pause for five minutes, then do something, and pause once again for five minutes...

Option Explicit

Dim PauseCount As Integer

Private Sub Form_Load()
Timer1.Interval = 60000 'one minute
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()

If PauseCount >= 5 Then
  PauseCount = 0
  'do some stuff
Else
  PauseCount = pausecnt + 1
End If

End Sub

Good Luck

vb5prgrmr 143 Posting Virtuoso

Start new standard exe project
Goto vb's ide menu Add-Ins > select add-in manager.
Look for VB 6 Data Form Wizard, highlight > Look at frame in bottom right corner with caption Load Behavior > select Loaded/Unloaded so check mark displays in check box. > OK
VB IDE Menu Add-Ins > Data Form Wizard
Run through wizard selecting your access database via browse button on screen 3.
On next form enter the name of the form you want, the style, and the type. I would suggest to start off with the ADO Code unless this is the first time you have ever played with VB.

Actually I would suggest that you use each option with each type and save that as a test project for reference. Then you will have it for reference.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Please post something else that cannot contain macros that can hurt our computers...

Thanks

vb5prgrmr 143 Posting Virtuoso

You can use the Printer.Print "some text", or the shellexecuteex API with the print keyword and notepad should handle it for you...

With first suggestion if you do not know how to read and write text files, look up the following in vb's help on index tab...

FreeFile Function
Open Statement
Input Function
Line Input Function
Close Statement


Good Luck

vb5prgrmr 143 Posting Virtuoso

Better yet...

Start new standard exe project
Goto vb's ide menu Add-Ins > select add-in manager.
Look for VB 6 Data Form Wizard, highlight > Look at frame in bottom right corner with caption Load Behavior > select Loaded/Unloaded so check mark displays in check box. > OK
VB IDE Menu Add-Ins > Data Form Wizard
Run through wizard selecting your access database via browse button on screen 3.
On next form enter the name of the form you want, the style, and the type. I would suggest to start off with the ADO Code unless this is the first time you have ever played with VB.

Actually I would suggest that you use each option with each type and save that as a test project for reference. Then you will have it for reference.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Start new standard exe project
Goto vb's ide menu Add-Ins > select add-in manager.
Look for VB 6 Data Form Wizard, highlight > Look at frame in bottom right corner with caption Load Behavior > select Loaded/Unloaded so check mark displays in check box. > OK
VB IDE Menu Add-Ins > Data Form Wizard
Run through wizard (use ODBC DSN)
On next form enter the name of the form you want, the style, and the type. I would suggest to start off with the ADO Code unless this is the first time you have ever played with VB.

Actually I would suggest that you use each option with each type and save that as a test project for reference. Then you will have it for reference.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Search for ADO Turorial VB6 on web or site. Also search this site for my handle (vb5prgrmr) and Data Form Wizard.

Good Luck

vb5prgrmr 143 Posting Virtuoso

HI

Thank's to reply

accualy i want that several forms displayed at same time and when information changes on one it changes on the others,but in my application when a form is desplaying on dektop,& i m clicking on other form so that's not opening.

Above is quote from PM...

Okay, when displaying several forms (and this is just a quick example) you can do something like this (however this reuses the same form so is not directly related to what you want to do with different forms but as for a visual example it works)...

Option Explicit

Private Sub Command1_Click()
Dim F As Form

Set F = New Form1
F.Left = 0
F.Top = 0
F.Width = Screen.Width / 2
F.Height = Screen.Height / 2
F.Show

Set F = New Form1
F.Left = Screen.Width / 2
F.Top = 0
F.Width = Screen.Width / 2
F.Height = Screen.Height / 2
F.Show

Set F = New Form1
F.Left = 0
F.Top = Screen.Height / 2
F.Width = Screen.Width / 2
F.Height = Screen.Height / 2
F.Show

Me.Left = Screen.Width / 2
Me.Top = Screen.Height / 2
Me.Width = Screen.Width / 2
Me.Height = Screen.Height / 2
End Sub

but if you have done something like this...

Option Explicit

Private Sub Command1_Click()
    Dim F As Form
    Set F = New Form1
    F.Show vbModal, Me
End Sub

then each form will display on top of one another and you will not be able to access any of …

vb5prgrmr 143 Posting Virtuoso

Last = top 1 desc
highest = max

Good Luck

vb5prgrmr 143 Posting Virtuoso

I think we are going to need a better explanation of what you want to do, because from reading your OP I can think of several things and some of them seem to be contrary to what you little sentance says...

So are you wanting to create a wizard like application in that the user goes from one form to the next filling out options?

Are you wanting several forms displayed at same time and when information changes on one it changes on the others?

Are you asking how to pass information from one form to another?

vb5prgrmr 143 Posting Virtuoso

App.HelpFile = App.Path & "\" & HelpFileName.hpj/chm

Good Luck

vb5prgrmr 143 Posting Virtuoso

See post #4 in this thread

http://www.daniweb.com/forums/thread181952.html

Use ODBC option for the Data Form Wizard and then goto http://www.connectionstrings.com to change it if you want


Good Luck

vb5prgrmr 143 Posting Virtuoso

DataGrid1.ReBind ???

Good Luck

vb5prgrmr 143 Posting Virtuoso

I know SQL has the capability of doing what you want through some of its tools as does access via get external data and I would normally suggest using a SELECT INTO query but the last time I dealt with Oracle was with 8i, I think.

Side Note:
That post is for showing you how to access any data source with ADO. Whether it be Access, Oracle, SQL, MySQL, Progress, and so on even if it was through and ODBC DSN and to change that code you could go to http://www.connectionstrings.com .

As for copying the entire table to the clipboard and pasting it into access, you could probably do that manually but I doubt you could do that through VB easily.

So, it is possible to use the Access Application directly and its Get External Data (ODBC DSN).

It may be possible to use an Oracle tool to export the data to access.

Through VB you could go the hard route and use an RS to open and retrieve the recordset and then use a connection object tied to access to do the inserts with in a loop as you run through the RS.

But the best solution through VB but don't exactly have the tools to test, is the previously mentioned INSERT INTO.

Good Luck

vb5prgrmr 143 Posting Virtuoso

See my reply, post #4 in this thread...

http://www.daniweb.com/forums/thread181952.html


Good Luck

vb5prgrmr 143 Posting Virtuoso

Table structure...
tblBadge
iBadgeID AutoNumber
iEmpID Number Foreign Key
dTimeIn date/time
dTimeOut date/time

tblEmployee
iEmpID AutoNumber
vFName text (25)
vMI text(1) Optional allow blanks/nulls
vLName text(25)


Then, see my reply in this thread post #4
http://www.daniweb.com/forums/thread181952.html


Good Luck

vb5prgrmr 143 Posting Virtuoso

Yes. At least is sounds like you can if this is a parent child relationship, meaning that table2 contains the foreign key from table1's unique ID field, or for some reason you are using two tables to contain unique information.

Look up INNER JOIN.

Good Luck

vb5prgrmr 143 Posting Virtuoso

see.... http://www.shrinkwrapvb.com to see if any of that code can help you.

Good Luck

vb5prgrmr 143 Posting Virtuoso
vb5prgrmr 143 Posting Virtuoso

Okay, these last posts have made me thought that you are unsure of what I am trying to say.

The select top 1 * means give me everything, each column from tablename. Then the order by field name is meant to be ordered by autonumber field. Then desc part means descending so you auto number field is numbered 1,2,3,4,5 and by order that field descending its order is 5,4,3,2,1 and with the select top 1 you get the record with the autonumber of 5 and thus you get the last record entered.

Now the max query even further above says for this field (your roll field) give me the largest number. So if in this column/field you had the values 1,5,3,2,5,4,3,2,1 then it would return the value of the 5.

Good Luck

vb5prgrmr 143 Posting Virtuoso
DataGrid1.Columns.Add 2

Good Luck

vb5prgrmr 143 Posting Virtuoso

Ya, know... I found a web site once that had a lot of information on this subject but now I can't find it.... Can't remember the name or search terms I used to find it....

Oh well.... See microsoft...

http://search.microsoft.com/results.aspx?form=MSHOME&mkt=en-US&setlang=en-US&q=speech+sdk


Good Luck

Roebuc commented: Thanks! +2
vb5prgrmr 143 Posting Virtuoso

It is possible but the results that you will get will not be in an easily readable format. Some decompilers break the code of an exe down to assembly, or C. While some say they break it down to VB code, you will not get the original code. What you will get is subs and functions with unintelligable names right along with all variables.

Good Luck

vb5prgrmr 143 Posting Virtuoso

I take it you are using the DriveListBox, DirListBox, and FileListBox, well maybe not the FileListBox but with the DriveListBox it is as simple as this...

Private Sub Command1_Click()
MsgBox Dir1.Path
End Sub

Good Luck

vb5prgrmr 143 Posting Virtuoso

Here are a couple of ways and by no means are these the only ways...

Option Explicit

Private Sub Form_Load()
Dim M As Integer, D As Integer, Y As Integer
Dim S As String, LastDay As Date

M = Month(Now)
D = Day(Now)
Y = Year(Now)

If IsDate(M & "/" & 28 & "/" & Y) = True Then D = 28
If IsDate(M & "/" & 29 & "/" & Y) = True Then D = 29
If IsDate(M & "/" & 30 & "/" & Y) = True Then D = 30
If IsDate(M & "/" & 41 & "/" & Y) = True Then D = 31

LastDay = M & "/" & D & "/" & Y
S = "The last day of this month is " & Format(LastDay, "dddd") & " "

MsgBox S & LastDay

'or
LastDay = M & "/" & 1 & "/" & Y
LastDay = DateAdd("m", 1, LastDay)
LastDay = DateAdd("d", -1, LastDay)

S = "The last day of this month is " & Format(LastDay, "dddd") & " "
MsgBox S & LastDay
End Sub

Good Luck

vb5prgrmr 143 Posting Virtuoso

Sounds like you will need to keep track of those previous numbers with some variables and its been a long time since I had to do anything to do with QBasic but an array would serve you nicely. Then you would need another variable to keep track of how many numbers have been entered.

Good Luck

vb5prgrmr 143 Posting Virtuoso

serkan sendur,

Please start your own thread

No. You will have to make your own form that looks like a message box.

Good Luck

vb5prgrmr 143 Posting Virtuoso
vb5prgrmr 143 Posting Virtuoso

Well with VB you need to have the correct library installed. i.e. for an office 97 access datbase you would need to have office 97 installed with the method you are trying to use. On the other hand if you use DAO, RDO, or ADO, more often than not the drivers to access most data sources come with the OS.

Now if you have Pro or Enterprise VB6 you should be able to use the Data Form Wizard.

Start new standard exe project>VB's IDE menu Add-Ins>Add In Manager>select VB 6 Data Form Wizard>In frame at lower right corner with caption of load behavior select Loaded/Unloaded so there is a check in the box.

Add-Ins>Data Form Wizard

Follow the instruction and use this wizard enough times to make sure that you have a form for each code/class/control and form type combination.

Save this project for future reference and to view any of the form or walk through with F8, set that form up as your startup form or modify Form1 so you can select any form you want to walk through with F8.

Good Luck

vb5prgrmr 143 Posting Virtuoso

No. Those are the names of the API's that you can look up on...

The Web
VB's Help Files
Microsoft's web site

To find examples on how to use.

Granted, API is not for beginners but how do you think experts get to be experts.

Good Luck

vb5prgrmr 143 Posting Virtuoso

FindWindow, EnumChildWindows, SendMessage API's

Good Luck

vb5prgrmr 143 Posting Virtuoso

Yes

vb5prgrmr 143 Posting Virtuoso

That query is not for showing the last roll, it was showing the max value roll. If you want the last roll then...

SELECT TOP 1 * FROM tablename ORDER BY field DESC

Good Luck

vb5prgrmr 143 Posting Virtuoso

FileCopy "Path File Name Of Source File", "Path File Name Of Destination File"


Good Luck

vb5prgrmr 143 Posting Virtuoso

So, Object variable not set...

Use the data form wizard to recreate the ADODC and grid you want. Then take that and place on your form.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Sorry Michael, that is .NET only and won't work in VB6.

Once you have the path to the temporary internet folder and if you can enumerate through its files by using DIR/FSO/FindFirstFile-FindNextFile/DriveListBox-DirListBox-FileListBox then you can use the FreeFile Function-Open Statement-Input Function-Line Input Function- and the close statement to read the contents of the cookie files (since they are text files).

Good Luck

vb5prgrmr 143 Posting Virtuoso

This is because of one of the quirks of ADO. -1 means that it has found records but does/did not get an accurate count. A couple of ways to get the accurate count and to test to see if you have records are as follows...

If adoRs.RecordCount <> 0 And adoRs.BOF = False And adoRs.EOF = False Then
  'then we have records
  adoRs.MoveLast
  MyRecordCount  = adoRs.RecordCount
  aodRs.MoveFirst
  '....
Else
  '...
End If

or you can explicitly get the count of records through a count query...

strSQL = "SELECT COUNT(*) AS THECOUNT FROM tablename 'where...
'execute...
MyCount = adoRs.Fields("THECOUNT")

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, it sounds like you will have to use standard proceedure to unregister dll and reregister the dll but before you do, I remember that you downloaded this dll because you did not find it on your system but when you went to install MDAC 2.5 you got the message that 2.5 had previously been installed...

So this means that 3.5 is prior (I'm betting) than MDAC 2.5 so with a quick search of MS I come up with this...

http://support.microsoft.com

searched on DAO350.DLL missing

and came up with this...

http://support.microsoft.com/search/default.aspx?qid=1279440&query=dao350.dll+missing&catalog=LCID%3D1033&mode=r

Looks like you are going to have to find the correct version and register it correctly.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Set gridCounter.DataSource = dataCounter?

Where is it defined?

Set gridCounter.DataSource = rsMyRs

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay,...

Now you may (possibly... don't freak out yet) either have bad registry entries or corrupt dll's and you are getting this message from Access right? Not Visual Basic 6.0! Does any other database open on your computer with Access? Are you running a 64 bit version of windows? If you are able to open a database or create a new one are you able to get to references with that one.

And finally...

It highlights that line. Is that line all by itself, or is is part of a procedure...

Public Function resetCharSet()
'code here
End Function

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, four approaches to solve your problem...

50,15,15 + 5% 52.5 (53), 16, 16 - 5% 47.5 (47), 14, 14

Fertilizer 1-----(24-2-8)---------------------100/bag
Fertilizer 2-----(20-20-20) ------------------50/bag
Fertilizer 3 -----(10-0-0)---------------------75/bag
Fertilizer 4----- (10-20-30)------------------20/bag

Start with cheapest price
(20/bag) X
(50/bag) X
(75/bag) OK (x5=50/0/0=not quite)
(100/bag) OK (x2=48/4/16=2/3 close)

Bags 1 and 2 disQ'ed because intiial mixtures 2 & 3 too high
Bag 3 does good for 1st but not 2 & 3
Bag 4 comes close 2 of 3 fall into requirements

(BTW 5% of 50 is 2.5 not 5)

Next method is opposite of above starting at most expensive

After that methods are by mixture.

Select highest quantity and figure out (like from cheapest) what it would take to fall in between +/- values starting at highest value of ingredient per bag, then test next highest to see if it is within and if not then back out 1 of what you used to come to your acceptable value for ingredient 1. Now pick highest value for two and add.... and so on until all three or best of 2 out of 3 works.

Last is reverse of above.

Good Luck

vb5prgrmr 143 Posting Virtuoso

I believe you need to download MDAC 2.5

There is a reason I said 2.5. 2.5 is the last MDAC with DAO contained within and your error states DAO...

vb5prgrmr 143 Posting Virtuoso

Enter new values that perhaps make sense and perhaps we can help you.

Sir BTW.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Unless the two tables are exact (TableDefs) then they... Is this VBA?

vb5prgrmr 143 Posting Virtuoso

See adobe's site and grab there PDF print driver... okay here it is...

http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=1500&fileID=1438

this is the installer that will check your system and download the postscript drivers so you can print to PDF. Then in your code you will need to change the default printer that you print to by using the set statement.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, what that error is telling you is that you have a unique field ID or otherwise and you are trying to add a duplicate entry. So the question arises. Are you trying to add a duplicate entry or update an ID field? Perhaps a look at your table structure might help because if you have a field that is supposed to be a foreign key but you have it constricted with a unique constraint then that may be your problem.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Whew! That is going to be a tough no matter how you look at it and as I look at it more it just may be impossible with the numbers you have given...

Lets take the four different mixtures to begin with and for arguements sake, they are all bags of equal weight.

Bag #1 24% Nitrogen, 2% Phosphate, 8% Potassium leaving 66% Filler
Bag #2 20% N, 20% P, 20% K, 40% Filler
Bag #3 10% N, 00% P, 00% K, 90% Filler
Bag #4 10% N, 20% P, 30% K, 40% Filler

and you want to get a mixture of
40% N, 30% P, 50% K, -20% Filler

The numbers just don't add up

Unless I am looking at this all wrong, I don't see a way this can be solved. I hope someone can come along with a different viewpoint or perhaps you could set me strait...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, don't need to change field name (sorry forgot how you had your tables designed), just change Table1 to Table2 and you will have you count of how many records in Table2 = whatever class name. Then on your roll field when you do your addnew you would use THECOUNT + 1, or you could use a different query if you wanted.

S = "SELECT MAX(roll) AS THEMAX FROM Table2 WHERE class = '" classname & "'"

Good Luck

vb5prgrmr 143 Posting Virtuoso

For sorting do a search for sorting vb6.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, the part you tried to highlight in red is constantly returning zero and it should be something like...

... = Combo1.ListIndex

That is, if what you need is the index number but if your field is 1 based and not zero based like the combo then you will need to do

... = (Combo1.ListIndex + 1)

However, if you are wanting to retrieve the text listed/selected in the combo box then you need...

... = Combo1.Text

Good Luck