Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by Andrzejek

  1. Andrzejek

    Select X of each variation of a field

    Select Distinct VERSION FROM MyTable You will get: A B C Now, loop thru the outcome from above and build this SQL: SELECT TOP (1) * FROM MyTable Where VERSION = 'A' UNION ALL SELECT TOP (1) * FROM MyTable Where VERSION = 'B' UNION ALL SELECT TOP (1) * FROM MyTable Where VERSION = 'C' Run...
  2. Andrzejek

    Select X of each variation of a field

    Could you show a sample of your data in a table? And expected result.
  3. Andrzejek

    Empty recordset stops

    You can also do: If EXH.BOF = EXH.EOF Then 'No records :-( Else 'Do your magic here End If
  4. Andrzejek

    stepping through table rows

    It may not be obvious to some, but Merlijn's example was made in VB6(Classic)/VBA (Excel or any other Office app)
  5. Andrzejek

    SORT DATE in msflexgrid not correct

    It is customary here at TT to share (even your own) solution so others who may have the same issue can benefit.
  6. Andrzejek

    CREATE msflexgrid as in xlsx file

    How about this way?
  7. Andrzejek

    How can i have more than 1 line in the body of an email

    Something like: .Body = "Good Day," & vbNewLine & vbNewLine & _ "Please let this Email serve as a verbal warning" BTW, there is a separate forum for VBA Visual Basic for Applications (Microsoft)
  8. Andrzejek

    Joining 4 tables issue

    If the User does not have any Role assigned, there is nothing to display in (role's) Name column for that User (unless you want to display: 'Role not assigned' or something like that) And I see kind of poor data in your st_role table: 800 Super Administrator ... 811 Super Administrator ... 916...
  9. Andrzejek

    Joining 4 tables issue

    It looks like you have 941 Users with no Role(s) assigned to them. And that's why their st_role.sf_name is NULL Their IDs are not in st_useraccount_roles table :(
  10. Andrzejek

    Joining 4 tables issue

    I cannot see your data in your tables, so it is difficult to know what's going on. It is possible you have Users without any Role(s)? To check, run this statement: Select sf_user_id From sf_user Where sf_user_id NOT IN (Select sf_user_id From st_useraccount_roles)
  11. Andrzejek

    Joining 4 tables issue

    Add to the end of your Select: Select ..., R.sf_name, R.df_role_id From... and see if you get id's for these NULLS. Is it possible you have some Roles without their names in st_role table?
  12. Andrzejek

    Joining 4 tables issue

    With your setup, I would assume every User belongs to just one Department, and can have at least one role, but user can be assigned more than one role, hence the st_useraccount_roles table. If that's true, I would try: SELECT U.sf_firstname as "First Name", U.sf_lastname as "Last Name"...
  13. Andrzejek

    set nothing form1

    You don't "put this code in command button". In the cmd you just need: Unload Me and the rest (setting form to nothing) is done in Private Sub Form_QueryUnload
  14. Andrzejek

    set nothing form1

    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) Set Form1 = Nothing End Sub
  15. Andrzejek

    Auto changing of small font sizes

    In VB6, all *.frm (form) files are just text files and you can open them in Notepad, for example. You are going to see something like below which you can change, save, an re-open in VB6 IDE VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ... StartUpPosition = 3 'Windows...

Part and Inventory Search

Back
Top