debasisdas 580 Posting Genius Featured Poster

please clarify why you need to open the same recordset each time ?

debasisdas 580 Posting Genius Featured Poster

its so strange that i have uploaded my project to show you what iam doing and you are still asking to show you my effort???

the solution to the problem is simple arithmetic.

@satti

so far as uploaded the entire project file is concerned, i am here to share my knowledge because i love to do so but i do not open each and every file / attachment that i come across in net.

debasisdas 580 Posting Genius Featured Poster

Try this.

SELECT CAST((STR( YEAR( @date ) ) + '-' +STR( MONTH( @date ) ) + '-' +STR( DAY(@date ) )
) AS DATE_AS_I_WANT

or this

SELECT CONVERT(varchar, @date,112)
debasisdas 580 Posting Genius Featured Poster

That is because you are opening the recordset everytime.

You need to open the recordset only once (in the form load).

debasisdas 580 Posting Genius Featured Poster

you simply need to use ASCII function and call the same in

KEY_PRESS or KEY_DOWN event

Show some effort before asking for code.

debasisdas 580 Posting Genius Featured Poster

Then you need to try to debug the part of the code that is causing the crash.

Comment the blocks of the code and check one by one.

debasisdas 580 Posting Genius Featured Poster

Along with a button on a form you need to have a database in place and connect to that Db from vb before you could do any database related activity.

debasisdas 580 Posting Genius Featured Poster

You must be looking for something that pays more with little to no work, right ?

debasisdas 580 Posting Genius Featured Poster

Can you post a snap shot your UI here, just for reference.

debasisdas 580 Posting Genius Featured Poster

What is not working ?

Are you getting any error message ?

debasisdas 580 Posting Genius Featured Poster

You need to create a new instance of the command button and reposition it every time by changing the X , Y co-ordinates.

But may i know what is the requirement that make you drag the button around the form.

debasisdas 580 Posting Genius Featured Poster

As mentioned in the previous post you need to play with some properties of the control.

debasisdas 580 Posting Genius Featured Poster

Yes, I think "real" 3D charts are a bit of a problem. I thought that MSChart could do them, but it seems that the "3D" charts it supports don't have 3 axes. They're just normal 2D (X/Y) charts with a pseudo-3D appearance showing a bit of depth to enhance the appearance . You may need to use some third party control.

debasisdas 580 Posting Genius Featured Poster

database changes
----------------

1. Migrate table/views and data to Oracle.

VB changes--assuming you are on ADO
-----------------------------------
1. Change connection string.
2. May need to take care of data types to make it compatible with Oracle.

debasisdas 580 Posting Genius Featured Poster

Try using IIF .

debasisdas 580 Posting Genius Featured Poster

Try using specific column name in the select query instead of using Select *

debasisdas 580 Posting Genius Featured Poster

When this thread was started you were asking about ToolTipText but now you have ended up creating a Context Menu. They are not one and same. While ToolTipText is just informational in nature, PopupMenu serves totally different purpose.

debasisdas 580 Posting Genius Featured Poster

So, do you have a question ?

debasisdas 580 Posting Genius Featured Poster

try this

Private Sub Cmdshutdown_Click()
   ExitWindows EWX_SHUTDOWN, &HFFFFFFFF
End Sub
debasisdas 580 Posting Genius Featured Poster

ToolTipText is display at the cursor.

a better work around is to
1. use a label
2. change the caption
3. move it around as desired with controlled visibility.

debasisdas 580 Posting Genius Featured Poster

In your case ,all depends on how much you can afford to spend.

and i don't think all versions of office is shipped with Access.

You can look for something like MySQL.

debasisdas 580 Posting Genius Featured Poster

I really do not understand what do you mean by -- I ran ltrim(), rtrim() and lower() function on data successfully. But fail to retrieve this data.

debasisdas 580 Posting Genius Featured Poster

Simply print system time at the beginning of the Procedure (before any looping or conditional branching) and once again at the end . and check the difference.

debasisdas 580 Posting Genius Featured Poster

Execution time is independent of lines of code.
It may happen that a procedure has 1000 lines of code because of a long running IF ELSE but the line 10 to 1000 never gets executed.

It depends on what the code is actually doing.

debasisdas 580 Posting Genius Featured Poster

Do not expect us to guess and solve your problem.

Please pass more information.

debasisdas 580 Posting Genius Featured Poster

@Vineeth

If a form is not visible (hidden), that does not mean the form is not loaded.

debasisdas 580 Posting Genius Featured Poster

What do yo expect a single line solution ?

The codes provided in the links is straight forward. It is lengthy because of long running IF and CASE statements.

debasisdas 580 Posting Genius Featured Poster

If your tables are linked through PK / FK, you need to delete from clild table record first and move upwards to parent table records and delete.

debasisdas 580 Posting Genius Featured Poster

Technically 2nd one.

debasisdas 580 Posting Genius Featured Poster

You need to use Max(value) + 1 logic.

Increment the max of current number by 1 and proceed.

debasisdas 580 Posting Genius Featured Poster

What is the project ?

What is the code that you are working on ?

Yo need to show effort to get help from our experts.

debasisdas 580 Posting Genius Featured Poster

Try to go through the code.
Understand if you can.
Implement the way you want....

debasisdas 580 Posting Genius Featured Poster

Try this sample SQL.

select * from (select * from aer order by aer_id desc)
where rownum <= (select count(*)/4 from aer)
debasisdas 580 Posting Genius Featured Poster

This may help you.

Also try to find here.

debasisdas 580 Posting Genius Featured Poster

All you luck is here.

debasisdas 580 Posting Genius Featured Poster

Why you always keep asking for code ?

Show some effort .

debasisdas 580 Posting Genius Featured Poster

Try this.....

Dim conn As New ADODB.Connection
Dim rec As New ADODB.Recordset

Private Sub cmd_delete_Click()
   Dim rResult
   
   rResult = MsgBox("Do you want to delete the record", vbYesNo)
   
   If rResult = vbYes Then
       conn.Execute "Delete * from Employee where EmployeeID =" & DataGrid1.Columns(0).Value
       
       Set DataGrid1.DataSource = Nothing
       Set rec = Nothing
       
       Set rec = New ADODB.Recordset
       rec.Open "Select * from Employee", conn, adUseClient, adLockOptimistic
       Set DataGrid1.DataSource = rec
   End If
End Sub

Private Sub DataGrid1_BeforeColUpdate(ByVal ColIndex As Integer, OldValue As Variant, Cancel As Integer)
    Dim rResult
    rResult = MsgBox("Do you want to Edit the record", vbYesNo)
   
   If rResult = vbNo Then
       Cancel = True
       DataGrid1.ReBind
   End If
End Sub

Private Sub DataGrid1_BeforeDelete(Cancel As Integer)
   Dim rResult
   
   rResult = MsgBox("Do you want to delete the record", vbYesNo)
   
   If rResult = vbNo Then
       Cancel = True
   End If
End Sub

Private Sub DataGrid1_Error(ByVal DataError As Integer, Response As Integer)
   Response = False
End Sub

Private Sub Form_Load()
   conn.Open "test"
   rec.Open "Select * from Employee", conn, adUseClient, adLockOptimistic
   
   Set DataGrid1.DataSource = rec
   DataGrid1.AllowUpdate = True
End Sub
debasisdas 580 Posting Genius Featured Poster

Please go through this.

debasisdas 580 Posting Genius Featured Poster

try this

select eid from certified
where eid = (select eid from 
(select eid,count(aid) from certified
group by eid
order by count(aid) desc)
                        where rownum<2)
debasisdas 580 Posting Genius Featured Poster

Please tell us more.

What is that control (grid) ?

What is the database ?

How it is connected ?

How are you populating the grid ?

debasisdas 580 Posting Genius Featured Poster

Why are you executing the script posted here, that was only an example. Does you table structure matches exactly the example posted here.

How are you calling the SQL from VB ?

How are you connecting to database ?

Have you connected to the database before calling the SQL ?

debasisdas 580 Posting Genius Featured Poster

kindly post the underlying table structure and desired output for further analysis.

debasisdas 580 Posting Genius Featured Poster

Yes it is.

Is not that clear from the post #4 ?

debasisdas 580 Posting Genius Featured Poster

what is not working ?

Vb code or database code ?

what is the code that you are working on ?

What is the error message ?

debasisdas 580 Posting Genius Featured Poster

why you need to post this question in vb 6 forum ?

debasisdas 580 Posting Genius Featured Poster

why not create a sub program and call in all the events you want it to execute.

debasisdas 580 Posting Genius Featured Poster

You need to maintain a flag ,and based on the flag value do what ever you want.

debasisdas 580 Posting Genius Featured Poster
SELECT First_Name FROM dbo.Names WHERE First_Name LIKE '%' +@letter+'%'

should work for you.

debasisdas 580 Posting Genius Featured Poster

try this

Private Sub cmdremove_Click()
         For i = 0 To list1.ListCount - 1
            If list1.Selected(i) = True Then
               list1.RemoveItem i 
            End If
         Next i
      End Sub
debasisdas 580 Posting Genius Featured Poster

That is interesting.

Newbies are quick learners :cool: