Search:

Type: Posts; User: SpookyAwol

Search: Search took 0.03 seconds.

  1. Datagridview Column 0 keeps reappearing

    This is for a winforms application within Visual Studio
    Is there a knack to keeping the ID column of a gridview hidden?

    I seem to have an issue whereby the first column (always the ID column)...
  2. Re: Closing Generated MS Word Doc causes error 'Call was rejected by callee'

    Another possibility I would guess, is :


    oWord.WindowState = Word.WdWindowState.wdWindowStateMinimize

    With oWord.ActiveDocument

    ' do word stuff

    End With
  3. Re: Closing Generated MS Word Doc causes error 'Call was rejected by callee'

    Do you have a simple example of what works? Im guessing its just the order of things, but trying this:



    Dim oWord As Word.Application
    oWord = New Word.Application
    ...
  4. Closing Generated MS Word Doc causes error 'Call was rejected by callee'

    Short intro - this is a Winform program which can generate MS Word reports.
    An error is created when a user trys to shut down the generating word report before the processing is complete (ie if its...
  5. Re: [RESOLVED] Maintaining selected items in DGV

    Stand down, resolved. Save was looking for a selected row, not the List integer
  6. [RESOLVED] Maintaining selected items in DGV

    In my Winform application, I have a DataGridView where a user can select options from the list. There may be one option, there may be 20.
    The DGV is multiselect and due to design constrains shows 4...
  7. VS Code Re: Detecting record change in datatable

    " I said that you bind the BindingSource to the grid, not the DataSource "
    I honestly thought that was a shorthand of the same thing. Thank you so much for pointing me in the right direction.
  8. VS Code Re: Detecting record change in datatable

    So with doing it this way, still no dice.
    Thats all the references in the binding changed.
    The DGV and textbox results still navigate as expected


    ClientID.DataBindings.Add("Text",...
  9. VS Code Re: Detecting record change in datatable

    Heres a cut down example of what I am using. Its again a winform, and all code is contained within the single form (as opposed to the MidiParent application.
    However the result is the same. What...
  10. VS Code Re: Detecting record change in datatable

    Sorry, yes I missed that - however still the same issue. Navigating through the DGV does not fire the event.
    Would I be correct in thinking that ClientBindingSource_CurrentChanged only fires when...
  11. VS Code Re: Detecting record change in datatable

    Should that be raised when included like so?

    Sub ClientBindingSource_CurrentChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ClientBindingSource.CurrentChanged

    ' code

    End...
  12. VS Code Re: Detecting record change in datatable

    Yes, Im meaning when a user selects a different record and there is a bindingsouce for that record that I forgot to show.
    When the user moves to a different record, Im trying to execute other code.
  13. VS Code [RESOLVED] Detecting record change in datatable

    Basic setup:


    da = New SqlDataAdapter()
    dt = New DataTable()
    SQL etc
    da.Fill(dt)
    DataGridView1.DataSource = dt
    <lots of bound text boxes>
    TourDataID.DataBindings.Clear()
  14. Re: These columns don't currently have unique values; Datarelation

    I may have answered my own question, reversing the logic suggests that is correct - TourID has to be an actual column in 'Clients' and not from a join (unless there is a workaround?).
    Using...
  15. [RESOLVED] These columns don't currently have unique values; Datarelation

    Im trying to wrap my head around datarelations to tidy up existing code and ended up with an error "These columns don't currently have unique values"

    Its working code when applied to simple...
  16. VS 2019 Re: Unable to cast COM object, MSWord

    Cheers for the options.

    > Run as Admin, no. Same error.
    > 32 bit already checked, removed and *BOOM* runs. Its obviously a 64/32 issue if thats the case, but now Ill need to see if it runs on the...
  17. VS 2019 [RESOLVED] Unable to cast COM object, MSWord

    Just trying to sort an early binding issue with MSWord, created from a Winform.
    Code works as expected on Client machine but not on dev machine.

    It works fine if late binding

    Error:


    An...
  18. Re: SQL Query to eliminate duplicates

    Pretty much :)
    Short of redesigning the database (and dealing with previous existing records) it gets messy real quick
  19. Re: SQL Query to eliminate duplicates

    Decided on a simple hack for now, added a column with a '0.5' decimal per Client when in same room, and '1' when they are single
  20. Re: SQL Query to eliminate duplicates

    This is the result of that SQL:

    WITH CTE (Col1, Col2, DuplicateCount) AS
    (SELECT ClientID, RoomWithID, ROW_NUMBER() OVER(PARTITION BY ClientID, RoomWithID ORDER BY ClientID)
    AS DuplicateCount...
  21. Re: SQL Query to eliminate duplicates

    The application is more for the Travel agents benefit - in that there is a bucket of rooms available (and could be within a range of local accommodation) , and its more about allocating rooms within...
  22. Re: SQL Query to eliminate duplicates

    Sadly Im dealing with the database I have been given and cant do a major redesign on it.
    In this application, there will only be one or 2 clients (and no its not that type of clientele!) . They dont...
  23. [RESOLVED] SQL Query to eliminate duplicates

    Ok, newb SQL guy here.

    I have a vb.net mission and one of my queries has me stumped. It can be done in code, but trying to do as much as possible in SQL

    The basic concept is a room booking...
  24. Re: Excel not formatting when creating new row

    Correct - working with 2x + 1
    All other formatting and formulas work, so Im happy Im working with the right row and its inserting that row correctly. Just not the borders.
    The borders for that...
  25. Re: Excel not formatting when creating new row

    I got the constant from https://docs.microsoft.com/en-us/office/vba/api/excel.xlpastetype but to be fair, nothing changes with or without so wondering if I have formatted the coding wrong
  26. Excel not formatting when creating new row

    Any excel experts that can point me in the right direction?

    Code below from a WinForm that creates an excel spreadsheet.
    Due to user input for an invoice, more lines sometimes have to be added....
  27. Re: Datagrid jumps to different record on msgbox

    Can you perhaps point me in the direction of what you consider a simple gold standard CRUD example so we have a good base to work off?
    Ive googled the heck out of it and unless you understand the...
  28. [RESOLVED] Datagrid jumps to different record on msgbox

    Im a little confused, which isnt unusual.

    This winform has a bound datasource and data displayed in a datagrid.
    CompanyID is bound to that data.

    With a single button, when pressed, the...
  29. Re: VS2019 Error, items inaccessible

    [Resolved]

    Turned it off then back on again.......
  30. [RESOLVED] VS2019 Error, items inaccessible

    Ive just generated a bit of an issue.
    Inside a MDIParent, I cut and pasted some code and then had second thoughts and removed it.

    However, I cant rebuild the solution as the ide thinks? it still...
  31. Replies
    5
    Views
    1,763

    Re: CellClick selected Datagridview row

    Can you just clarify what a 'discrete control' is in this context?
  32. Replies
    5
    Views
    1,763

    Re: CellClick selected Datagridview row

    Thanks for your (brutal) honesty ;)
    The bindingsource is bound to the datagrid so I can filter and manipulate the list and use the data elsewhere. I think I have grasped that concept although thats...
  33. Replies
    5
    Views
    1,763

    CellClick selected Datagridview row

    With my code, I want to be able to action a cellclick on an existing datagrid.
    I can set the record (ID) and highlight the row as selected (as below), however need the next step to automatically...
  34. Replies
    6
    Views
    1,183

    Re: How to Fill multiple datagrid

    Same result unfortunately, but if you have a short code sample of the 'normal' or better way of doing it, Im all ears!

    Like i say, Im trying to convert my way of thinking from vb6 where I kept the...
  35. Replies
    6
    Views
    1,183

    Re: How to Fill multiple datagrid

    The exception is cannot find table 1? It appears the results all end up in the first datagrid
  36. Replies
    6
    Views
    1,183

    How to Fill multiple datagrid

    Trying to wrap my head around vb6 -> .net
    What do I need to change to fill 3 datagridviews with different data?
    I populate the grids during startup and refer to them at various points in the...
  37. Replies
    5
    Views
    2,200

    Re: There is no row at position 0

    Wow. Legend, it was that simple... so much head scratching...Cheers!
    And, thanks also dday9, Ive also bookmarked your web site.
  38. Replies
    5
    Views
    2,200

    Re: There is no row at position 0

    What would it suggest is wrong if it doesnt go past msgbox("execute reading") ?
    No errors, just doesnt complete the .read




    Dim reader = cmd.ExecuteReader()

    ...
  39. Replies
    5
    Views
    2,200

    There is no row at position 0

    Hi Guys, First time caller, long time listener

    Im trying to convert a hobby project from vb6 (word templates / Access Database) to Visual Basic .net in Visual Studio 2019


    Private Sub...
Results 1 to 39 of 39



Click Here to Expand Forum to Full Width