aktharshaik 16 Posting Whiz

Try This

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

    Dim objRecip As Recipient
    Dim strMsg As String
    Dim res As Integer
    Dim strBcc As String
'ADDED LINES *********
    Dim nameSel As Outlook.SelectNamesDialog
'ADDED LINES *********

    On Error Resume Next

    ' #### USER OPTIONS ####
    ' address for Bcc -- must be SMTP address or resolvable
    ' to a name in the address book
'ADDED LINES *********
    Set nameSel = Session.GetSelectNamesDialog
    nameSel.AllowMultipleSelection = False
    nameSel.NumberOfRecipientSelectors = olShowToCcBcc
'ADDED LINES *********

    strBcc = "email@address.com"
    Set objRecip = Item.Recipients.Add(strBcc)
    objRecip.Type = olBCC
    If Not objRecip.Resolve Then
        strMsg = "Could not resolve the Bcc recipient. " & _
                 "Do you want still to send the message?"
        res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
              "Could Not Resolve Bcc Recipient")
        If res = vbNo Then
            Cancel = True
        End If
    End If
    Set objRecip = Nothing
    Set nameSel = Nothing

End Sub
aktharshaik 16 Posting Whiz

As per your code my assumptions
1) conn is ADODB.Connection for access DB
2) iMUSIC is table in SQL Server DB

Private Sub ListTemp_Click()

        Dim sqltambah As String

        'Better Add Error Handler Code also
        On Error goto ListTemp_Click_Error

        'if you already have an active ADODB.Connection to your SQL Server Schema use it.
        'If not then create one ADODB.Connection and connect it to your SQL Server Schema
        'where your iMUSIC table resides
        'Here I assume sqlconn as the ADODB.Connection to your SQL Server Schema

        Dim sqlconn as New ADODB.Connection
        sqlconn.open "<here goes the SQL provider connection string to your SQL Server Schema>"

        'sqltambah is only a string variable which holds your Insert Query
        sqltambah = "INSERT INTO iMUSIC " & _
                    "(ID_MUSIC, TITLE, SINGER, FID_M_CATEGORY, FILE_NAME, SOURCE, PATH, ACTIVE, VOL , ANALOG, DATE_ADDED)" & _
                    " VALUES (" & _
                    "'" & Text1.Text & "', " & _
                    "'" & Text3.Text & "', " & _
                    "'" & Text2.Text & "', " & _
                    "'" & CB_kategori.Text & "', " & _
                    "'" & filename_txt.Text & "', " & _
                    "'" & source_txt.Text & "', " & _
                    "'" & path_txt.Text & "', " & _
                    "'" & active.Caption & "', " & _
                    "'" & vol_txt.Text & "', " & _
                    "'" & CB_Analog.Text & "', " & _
                    "'" & DTPicker1.Value & "' " & _
                    ")"

        'This is the Access Database Recordset with  conn  as ADODB.Connection to your MS-Access DB
        Set rsmusik = New ADODB.Recordset …
aktharshaik 16 Posting Whiz

Hi,

You can delete any file from the disk using the KILL command

Syntax:
KILL <filename with path>

Before deleting any file you can check if it exists in the path or not first.

If Dir("D:\PRLIST.XLS", vbNormal) <> "" Then
        If MsgBox("DELETE FILE?", vbYesNo + vbInformation, "DELETION") = vbYes Then
            Kill "D:\PRLIST.XLS"
        End If
    Else
        MsgBox "No Such File Exists."
    End If

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

Also refresh the ADODC Control

Adodc.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & App.Path & "\test.accdb;Persist Security Info=False"
    Adodc.CommandType = adCmdText
    Adodc.RecordSource = "SELECT * FROM USERS"
    [U]Adodc.Refresh[/U]
aktharshaik 16 Posting Whiz

Corrected Code

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyC Then
        If Shift = 2 Then
             Clipboard.Clear
             Clipboard.SetText grd.Clip
        End If
    End If
End Sub

PS: For this to work set the KeyPreview Property of the your FORM to "True"

Regards
Shaik Akthar

debasisdas commented: agree, welcome back. +13
aktharshaik 16 Posting Whiz

Hi,
It is better to start a new thread.
Anyhow here is some solution i can get for u.

Open VB IDE.

1. Insert your ADODC Control in your form.
2. Insert the Command Button.
3. Open the Code Window for Command_Click() and Use this code to set the ADODC Control Properties

Adodc.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & App.Path & "\test.accdb;Persist Security Info=False"
    Adodc.CommandType = adCmdText
    Adodc.RecordSource = "SELECT * FROM USERS"

Rest you make out and get back if any problem.

Regards
Shaik Akthar

marcmanlin2 commented: Thanks +0
aktharshaik 16 Posting Whiz

Hi!!!

For more information, read this KB Article

http://support.microsoft.com/kb/193866

aktharshaik 16 Posting Whiz

Hi!!!

Use the following syntax for the SQL Query

SELECT * from customer where customercode = ?

? will display the parameter in the parameter tab

aktharshaik 16 Posting Whiz

Please send your complete code once, so that i may identify the problem.

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

First of all let me make the steps clear.

1. U have separate schema for each project in oracle database.
2. For each project u have related excel file in their respective folders.
3. When a project is to be opened u need to select the related ini file.
4. Once the ini file is selected, the project is opened.

Now u want to take which project opened from the ini file to access its schema.
and for that project u need to open its related excel file.

Is it what u r in need of?

aktharshaik 16 Posting Whiz

u can maintain a table in the schema itself which maps the UIDs to their respective excel files. read the data from the table using adodb or any other way u can access the data and open the specific file related to that UID.

aktharshaik 16 Posting Whiz

select TblRePayment.project_code, TblRePayment.ref, TblRePayment.rdate, TblRePayment.princ, TblRePayment.service FROM TblRePayment UNION ALL SELECT TblRePayment_re.project_code, TblRePayment_re.ref, TblRePayment_re.rdate, TblRePayment_re.princ, TblRePayment_re.service FROM TblRePayment_re

try the above query.

aktharshaik 16 Posting Whiz

Go to Tools -> Options

Put a checkmark to Hidden Objects

aktharshaik 16 Posting Whiz

Please refer my thread for the requirement
http://www.daniweb.com/forums/thread139729.html

hope this solves ur doubt.

aktharshaik 16 Posting Whiz

Hi!
I don't know how u have managed to assign the client number to a variable. but here is one way to do so.
when u execute the query using the Execute function, all the values retrieved are as a recordset.
For Eg:

Dim myGrade as String
Dim myClientNo as Long

myName = deSub.conn.Execute("SELECT clientgrade FROM individualsubs WHERE firstname = '" & txtfname.Text & "' AND surname = '" & txtsurname.Text & "'")(0)
myClientNo = deSub.conn.Execute("SELECT clientgrade, clientnumber FROM individualsubs WHERE firstname = '" & txtfname.Text & "' AND surname = '" & txtsurname.Text & "'")(1)

Here (0) and (1) tell which retrieved value is to be used.

Also be careful if any null values are to be retrieved and handle the error respectively.

aktharshaik 16 Posting Whiz

Use Form_KeyDown event

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
'make sure KeyPreview is True on Form Properties
  On Error Resume Next
  Select Case KeyCode
    Case vbKey 'Then Find which key you want to use from the list below
        'Code to run when key is pressed
  End Select
End Sub

List of every key on the keyboard:
vbKeyLButton Left Mouse Button
vbKeyRButton Right Mouse Button
vnKeyCancel Cancel Key
vbKeyMButton Middle Mouse button
vbKeyBack Back Space Key
vbKeyTab Tab Key
vbKeyClear Clear Key
vbKeyReturn Enter Key
vbKeyShift Shift Key
vbKeyControl Ctrl Key
vbKeyMenu Menu Key
vbKeyPause Pause Key
vbKeyCapital Caps Lock Key
vbKeyEscape Escape Key
vbKeySpace Spacebar Key
vbKeyPageUp Page Up Key
vbKeyPageDown Page Down Key
vbKeyEnd End Key
vbKeyHome Home Key
vbKeyLeft Left Arrow Key
vbKeyUp Up Arrow Key
vbKeyRight Right Arrow Key
vbKeyDown Down Arrow Key
vbKeySelect Select Key
vbKeyPrint Print Screen Key
vbKeyExecute Execute Key
vbKeySnapshot Snapshot Key
vbKeyInsert Insert Key
vbKeyDelete Delete Key
vbKeyHelp Help Key
vbKeyNumlock Delete Key

vbKeyA through vbKeyZ are the key code constants for the alphabet
vbKey0 through vbKey9 are the key code constants for numbers
vbKeyF1 through vbKeyF16 are the key code constants for the function keys
vbKeyNumpad0 through vbKeyNumpad9 are the key code constants for the numeric key pad

Math signs are:

aktharshaik 16 Posting Whiz
aktharshaik 16 Posting Whiz

Check the following thread. I have written some code. May be of some help. If not then u may post back for further requirement stating some sample data.
http://www.daniweb.com/forums/thread139729.html

aktharshaik 16 Posting Whiz
aktharshaik 16 Posting Whiz

if badge_id column a numeric, then omit the quotation marks for '1234'

aktharshaik 16 Posting Whiz

what is the error msg u r getting.

aktharshaik 16 Posting Whiz
aktharshaik 16 Posting Whiz
aktharshaik 16 Posting Whiz
aktharshaik 16 Posting Whiz

Insufficient Info provided.

aktharshaik 16 Posting Whiz

Please post some sample data.
Say 5 records for each table.
and the desired result output.
I will try help u out with this. by the way, which db r u using? MS-Access or SQL Server or...

Regards
Shaik Akthar

aktharshaik 16 Posting Whiz

to delete a row u have to use F9. I have assigned F9 for row Deletion.

aktharshaik 16 Posting Whiz

I have already written the program such that u give the quantity and press enter it will automatically create a new row and go to the first column of the new row. If the quantity is zero then the new row addition increment will not happen.

aktharshaik 16 Posting Whiz

Run the project i HAVE sent u once.

aktharshaik 16 Posting Whiz

Select your Product and press enter. the Qty column will be highlighted. again press enter to edit the quantity cell. a textbox will come in the place of the cell and u can enter your quantity there and press enter to accept or escape to cancel the quantity entered.

aktharshaik 16 Posting Whiz

When this error shows up, without clicking the OK button,

Press Ctrl + (Break/Pause) button and debug each statement execution by pressing F8 key (executing one line at a time for each press of F8 key) till the line of error in Grd_LeaveCell event is highlighted

and post the highlighted line in Grd_LeaveCell() event


Also change the following statement in RED your MR form.

Private Sub SetProductValues()

    Dim rs As New ADODB.Recordset

    On Error GoTo SetProductValues_Error

    rs.Open " SELECT ITEM_CODE, PRODUCTNAME, MAXOFUNIT FROM PARTDETAIL WHERE ITEM_CODE = '" & Grd.TextMatrix(Grd.Row, cItemCode) & "' ", con, adOpenKeyset, adLockReadOnly
    If rs.BOF = False Then
        Grd.TextMatrix(Grd.Row, cItemName) = rs!ProductName
        Grd.TextMatrix(Grd.Row, cUnit) = [B]rs!MAXOFUNIT & ""[/B]
    End If

SetProductValues_Done:
    If rs.State Then rs.Close
    Set rs = Nothing
    Exit Sub

SetProductValues_Error:
    Call Process_Error(MODULE_NAME, "SetProductValues")
    Resume SetProductValues_Done

End Sub
aktharshaik 16 Posting Whiz

could not get what your idea or requirement. plz elaborate with some example.

aktharshaik 16 Posting Whiz

Use some other notation for those dummy fields like in the query which i had suggested in the last post.

Table2.tk2 AS sTK, '***' as sFATHER, -999 as sAGE, '***' as sPLACE

aktharshaik 16 Posting Whiz

Here's the solution for your error problem.

aktharshaik 16 Posting Whiz
rs.Open "Select PCODE from Product WHERE PCODE = '" & Trim(Text1.Text) & "'", cn, adOpenKeyset, adLockPessimistic
If rs.BOF = False Then
    MsgBox "The Product Code is Already Exist!", vbCritical
    If rs.State Then rs.Close
    Set rs = Nothing
    Exit Sub
Else
aktharshaik 16 Posting Whiz

I think i identified ur problem. plz wait another 30 mins

aktharshaik 16 Posting Whiz

Make
List1.itemData(List1.NewIndex) = QBColor(I)
as
lstProject_report.itemData(lstProject_report.NewIndex) = QBColor(I)

aktharshaik 16 Posting Whiz

Ok. Send me the setup

aktharshaik 16 Posting Whiz

Referring Grd if same as referring to the Current Cell which is active.
u can even write

Grd.TextMatrix(Grd.Row, Grd.Col) = FlexGridEditor.Value

When you press enter in the Product Id Column the FlexGridEditor control becomes visible populating all ur Products. When FlexGridEditor needs to be made Visible = False then the Value in the cell is temporarily stored in strOldValue and the cell is updated. Lest any problem, the old value can be replaced by

Grd = strOldValue

Hope this solves ur doubt.
Is it working anyway?

aktharshaik 16 Posting Whiz
aktharshaik 16 Posting Whiz
'In MR Form Change the FieldName from UNIT  to  MaxOFUnit
'I already adviced u to have a look at the fieldnames which i have given
'In ur PARTDETAIL Query you have given 
'MaxOfUnit as the Output Field Name

Private Sub SetProductValues()

    Dim rs As New ADODB.Recordset

    On Error GoTo SetProductValues_Error

    rs.Open " SELECT ITEM_CODE, PRODUCTNAME, MAXOFUNIT FROM PARTDETAIL WHERE ITEM_CODE = '" & Grd.TextMatrix(Grd.Row, cItemCode) & "' ", con, adOpenKeyset, adLockReadOnly
    If rs.BOF = False Then
        Grd.TextMatrix(Grd.Row, cItemName) = rs!ProductName
        Grd.TextMatrix(Grd.Row, cUnit) = rs!MAXOFUNIT
    End If

SetProductValues_Done:
    If rs.State Then rs.Close
    Set rs = Nothing
    Exit Sub

SetProductValues_Error:
    Call Process_Error(MODULE_NAME, "SetProductValues")
    Resume SetProductValues_Done

End Sub

also the same issue in Products Class Module.

Public Function GetAll(Optional ByVal vstrProductID As Variant, Optional ByVal vstrProductName As Variant, Optional ByVal vstrProductUnit As Variant) As ADODB.Recordset

    On Error GoTo GetAll_Error

    If DataPath = "" Then Exit Function

    Dim rs As ADODB.Recordset
    Dim strSql As String
    Dim cn As ADODB.Connection

    Set cn = New ADODB.Connection
    cn.CursorLocation = adUseClient
    cn.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & DataPath
    Set rs = New ADODB.Recordset
    strSql = " SELECT ITEM_CODE, PRODUCTNAME, MAXOFUNIT FROM PARTDETAIL WHERE "

    If Not IsMissing(vstrProductID) Then strSql = strSql & " ITEM_CODE = " & "'" & Replace(vstrProductID, "'", "''") & "'" & " AND "
    If Not IsMissing(vstrProductName) Then strSql = strSql & " PRODUCTNAME = " & "'" & Replace(vstrProductName, "'", "''") & "'" & " AND "
    If Not IsMissing(vstrProductUnit) Then strSql = strSql & " MAXOFUNIT = " & "'" & …
aktharshaik 16 Posting Whiz

Also please note down the entire error message and post it here along with the Module Name, Procedure Name, Error Number and Description.

aktharshaik 16 Posting Whiz

Firstly, did u get any error msgs while adding those files to the project.

Then open Class Module Products.cls. Check out the Tablename and FieldNames which i have given are correct or not.

If possible plz post database if u can. it will be very easy to solve if i can see the database.

The error u got is related to fieldname of PARTDETAIL i think. since i exactly don't know the fieldname spellings, maybe i might have spelled them wrongly.

aktharshaik 16 Posting Whiz

sorry i could not upload the files yesterday. you might have waited hoping for my reply. sorry for the inconvenience. Actual problem was that my internet connection was down from yesterday night till today morning. that was why i was unable to upload the solution. I had the code written yesterday night only by 10PM. (may be 7pm at ur side)

aktharshaik 16 Posting Whiz

Hi! I worked through the solution for nearly 5 hours. At last arrived at some sort of solution. i hope for the best that it will help u. I am uploading the ZIP File here.

NOTES ON USING THE SENT FILES.
-------------------------------------------
Unzip this file some where else other than your project. and Before overwriting any of your work with the given logic, make a backup of ur project.

I am sending a total of 8 files (3 Modules, 1 class module, 2 user controls of 3files and the MR form u have given)

once u have unzipped them to a location and having ur current project backup.

1. Open your CURRENT project with which u r working. (don't open "FINALMR.VBP" project which is included in the zip file i have sent you.)

2. From the Project->Components menu make sure u have these 2 controls are selected. a) Microsoft Hierarchical Flex grid Control (MSHFLXGD.OCX) and b) Microsoft Windows Common Controls-2 6.0 (MSCOMCT2.OCX)

3. Project -> Add Module and add the three modules i have sent one by one. (ADOSUPPORT.BAS, MODERROR.BAS & MODGLOBALVARS.BAS)

4. Project -> Add Class Module and add the PRODUCTS.CLS

5. Project -> Add User Control and add the "uscEntityCode.ctl" first. (IMPORTANT)

6. Then Project -> Add User Control and add the "uscMSFlexGridEditor.ctl"

7. Lastly Replace your MR form with the one which i have modified.

8. Run Check ur program and get back if …

aktharshaik 16 Posting Whiz

what is the Name property of your Command Object. is it rsCommand1 or only Command1

Try replacing rsCommand1 with Command1

aktharshaik 16 Posting Whiz

ok. will get back to you by your time of 6:30pm

aktharshaik 16 Posting Whiz

with reference to QVeen72 earlier post, if u have copied and pasted the code for the SQL Query then maybe the table name u have got wrong.

Select * From MyTable Where Fees Between ? And ?

Here replace the MyTable with relevant table name of ur database.

aktharshaik 16 Posting Whiz

Here it is 6:00 PM. I can work it out and give it 2 u in another 3-4 hrs.
By the way what is the time there now?

aktharshaik 16 Posting Whiz

If you can do it with getting some help on DataGrid, u can try by the time.