Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
skillsboy  
#1 Posted : Monday, July 29, 2019 10:49:20 AM(UTC)
skillsboy

Rank: Newbie

Groups: Registered
Joined: 7/24/2019(UTC)
Posts: 6

Thanks: 4 times
If i use "igCellCombo" it works fine, it shows the "State" instead of its ID.
But when I try using the "igCellTextCombo" it shows the "StateID" in the cells and the "State" names in the dropdown, I would like to see the "State" in the cells like when i use "igCellCombo" if possible.

Code:
    Dim rsMain As DAO.Recordset
    Dim rsSate As Dao.Recordset
    Dim State  As ComboObject

    Set rsMain = CurrentDb().OpenRecordset("qry_Main")
    Set rsState = CurrentDb().OpenRecordset("tbl_State")     'SELECT StateID, State FROM tbl_State;
    Set State = iGrid2.Combos.Add("State")
    
    State.FillFromRS rsState, "State", "StateID"
        
    With iGrid2.AddCol(sKey:="State", sHeader:="State")
        .eType = igCellTextCombo
        .sCtrlKey = "State"
    End With
    
    iGrid2.FillFromRS rsMain

    Set rsMain = Nothing
    Set rsState = Nothing

Edited by user Monday, July 29, 2019 10:51:16 AM(UTC)  | Reason: Not specified

Igor/10Tec  
#2 Posted : Monday, July 29, 2019 4:09:12 PM(UTC)
Igor/10Tec

Rank: Administration

Groups: Administrators, Forum Moderator
Joined: 1/17/2011(UTC)
Posts: 1,101

Thanks: 15 times
Was thanked: 141 time(s) in 141 post(s)
The igCellTextCombo cell type implies that you can enter any arbitrary text into the cell. In this case the attached drop-down list can be used only as the source of strings for fast input without any link to hidden values (IDs) because in the general case there is no corresponding ID for any arbitrary string.
thanks 1 user thanked Igor/10Tec for this useful post.
skillsboy on 7/29/2019(UTC)
skillsboy  
#3 Posted : Monday, July 29, 2019 4:27:24 PM(UTC)
skillsboy

Rank: Newbie

Groups: Registered
Joined: 7/24/2019(UTC)
Posts: 6

Thanks: 4 times
Ok then I will use "igCellCombo".

But there is a thing I can't do while using "igCellCombo", i want to copy a cell from this column and paste it in one or more cells from the same column. It says type mismatch.

Is there any possible way around this?
Igor/10Tec  
#4 Posted : Tuesday, July 30, 2019 11:51:38 AM(UTC)
Igor/10Tec

Rank: Administration

Groups: Administrators, Forum Moderator
Joined: 1/17/2011(UTC)
Posts: 1,101

Thanks: 15 times
Was thanked: 141 time(s) in 141 post(s)
As you may know, iGrid tries to convert the value you put into a cell to the type of the existing cell value - no matter whether it is interactive text editing or copy/paste. When you copy the contents of a combo box cell and pastes it into another combo box cell, actually iGrid copies the value of the source combo item and tries to convert it to the type of the values in the destination cell. If this process fails, you see the error. This can happen if both cells use the same combo list but the values of its items have different data types.

If you can reproduce the problem in a simple project and send it to us (or publish here), we can discuss how to change your code to avoid this problem.
skillsboy  
#5 Posted : Thursday, August 1, 2019 11:12:21 AM(UTC)
skillsboy

Rank: Newbie

Groups: Registered
Joined: 7/24/2019(UTC)
Posts: 6

Thanks: 4 times
Originally Posted by: Igor/10Tec Go to Quoted Post
As you may know, iGrid tries to convert the value you put into a cell to the type of the existing cell value - no matter whether it is interactive text editing or copy/paste. When you copy the contents of a combo box cell and pastes it into another combo box cell, actually iGrid copies the value of the source combo item and tries to convert it to the type of the values in the destination cell. If this process fails, you see the error. This can happen if both cells use the same combo list but the values of its items have different data types.

If you can reproduce the problem in a simple project and send it to us (or publish here), we can discuss how to change your code to avoid this problem.


Here is small sample project.

What I would like is to copy one cell to multiple cells all this in the "Sec" column.

I appreciate the help.


ps: i can't upload ".accdb", nor could I upload ".png", so here is what I have.

Code:
Option Compare Database

Private Sub igrid1_formating()
'formatting
    With iGrid1.Header
        .ForeColor = vbBlack
        .Font.Size = 12
        .Font.Bold = True
        .UseXPStyles = False
    End With

    With iGrid1.Font
        .Size = 10
    End With

    With iGrid1
        .AutoHeightRows
    End With
    
    For iCol = 1 To iGrid1.ColCount
       iGrid1.AutoWidthCol iCol
    Next
End Sub

Private Sub Form_Load()
    Dim rsMain  As DAO.Recordset
    Dim rsSec   As DAO.Recordset
    
    Dim Sec     As ComboObject
    
    Set rsMain = CurrentDb().OpenRecordset("tbl_Main")
    Set rsSec = CurrentDb().OpenRecordset("tbl_Sec")
    
    Set Sec = iGrid1.Combos.Add("Sec")
    
    iGrid1.BeginUpdate
    
    'properties
    iGrid1.MultiSelect = True
    
    'populate dropdowns
    Sec.FillFromRS rsSec, "Sec", "SecID"
    
    'add columns
    With iGrid1
        With .AddCol(skey:="MainID", sHeader:="ID")
        End With
        With .AddCol(skey:="SecID", sHeader:="Sec")
            .eType = igCellCombo
            .sCtrlKey = "Sec"
        End With
        With .AddCol(skey:="Other", sHeader:="Other")
        End With
    End With
    
    'populate columns
    iGrid1.FillFromRS rsMain
    
    'formatting
    Call igrid1_formating

    iGrid1.EndUpdate
    
    Set rsMain = Nothing
    Set rsSec = Nothing
End Sub


sample.png
Igor/10Tec  
#6 Posted : Friday, August 2, 2019 4:15:40 PM(UTC)
Igor/10Tec

Rank: Administration

Groups: Administrators, Forum Moderator
Joined: 1/17/2011(UTC)
Posts: 1,101

Thanks: 15 times
Was thanked: 141 time(s) in 141 post(s)
Can you pack and send us the .accdb file demonstrating the problem to our main support address (contact@10tec.com) for the further consideration?

Have you tried to upload the .accdb file packed into a .zip archive to this forum?

Edited by user Friday, August 2, 2019 4:18:16 PM(UTC)  | Reason: Not specified

thanks 1 user thanked Igor/10Tec for this useful post.
skillsboy on 8/2/2019(UTC)
skillsboy  
#7 Posted : Friday, August 2, 2019 5:26:00 PM(UTC)
skillsboy

Rank: Newbie

Groups: Registered
Joined: 7/24/2019(UTC)
Posts: 6

Thanks: 4 times
copy 1cell to multiple cells combobox-sample.rar (30kb) downloaded 2 time(s).

I dind't see i could upload zip, rar...

Do you still want me to send it to the email?

What I would like to do:
- Copy one cell from "Sec" column (combobox) to one or more cells in "Sec" column (combobox).

Example:
1-Copy Value from [Sec] where [ID]=2
2-Paste that Value to [Sec] where [ID]=4 & [ID]=6

What happens:
1-"Thanche 1" is copied to clipboard
2-When pasted error occurs: "Invalid value: Type mismatch"

This only happens on comboboxes/dropdowns, I guess because they save two different values CellValue & CellText.
Igor/10Tec  
#8 Posted : Monday, August 5, 2019 11:31:59 AM(UTC)
Igor/10Tec

Rank: Administration

Groups: Administrators, Forum Moderator
Joined: 1/17/2011(UTC)
Posts: 1,101

Thanks: 15 times
Was thanked: 141 time(s) in 141 post(s)
I reproduced the problem under the debugger and know why it occurs.

Let's discuss possible ways to solve this problem in emails.

Edited by user Monday, August 5, 2019 11:34:50 AM(UTC)  | Reason: Not specified

thanks 1 user thanked Igor/10Tec for this useful post.
skillsboy on 8/6/2019(UTC)
Igor/10Tec  
#9 Posted : Tuesday, August 6, 2019 9:25:59 AM(UTC)
Igor/10Tec

Rank: Administration

Groups: Administrators, Forum Moderator
Joined: 1/17/2011(UTC)
Posts: 1,101

Thanks: 15 times
Was thanked: 141 time(s) in 141 post(s)
skillsboy, we sent you a link to an interim build of iGrid with the bug fix and some related questions to your email. Have you received it? If not, check the Junk Emails folder. Perhaps, our letter was placed in it mistakenly by your anti-spam filter.
thanks 1 user thanked Igor/10Tec for this useful post.
skillsboy on 8/6/2019(UTC)
skillsboy  
#10 Posted : Tuesday, August 6, 2019 10:17:13 AM(UTC)
skillsboy

Rank: Newbie

Groups: Registered
Joined: 7/24/2019(UTC)
Posts: 6

Thanks: 4 times
Originally Posted by: Igor/10Tec Go to Quoted Post
skillsboy, we sent you a link to an interim build of iGrid with the bug fix and some related questions to your email. Have you received it? If not, check the Junk Emails folder. Perhaps, our letter was placed in it mistakenly by your anti-spam filter.


Yes I did receive it, thank you!

I wasn't available yesterday, but I will reply to the email today.

Edited by user Tuesday, August 6, 2019 10:19:07 AM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.