Search results

  1. J

    automatically populate combo box with available tables using SQL

    dcx693 proposed a very nice method of performing this task using an ADO. In the mean time, however, some other means to performing this were suggested using an SQL scripts and a query. The query would have in its criteria field (by WayneRyan): Name not like "MSys*" and Type = 1 and the SQL...
  2. J

    Is there a wildcard character that VB recognizes?

    I'd like to perform the following code: Me!Del1.Visible = False Me!Del2.Visible = False Me!Del10.Visible = False Me!DelA.Visible = False Me!Del.Visible = False with the following code "concept": Me!Del*.Visible = False Currenlty, VB notes this code as a syntax error. Is there some...
  3. J

    Can you set RecordSource to Null?

    AddDate is the name of the control. I do like your {Not IsNull(me.AddDate)} code, it seems much more "code-appropriate" than checking to see if the length is zero. I've been having a tough time figuring out how Access (or VB) handles Null. Thanks for the code tip, Fizzio.
  4. J

    Can you set RecordSource to Null?

    I suppose it very well could be a difference between Access 2000 and 2002. This is my Report function (that "calls" the Form): Private Sub Report_Open(Cancel As Integer) Me.RecordSource = "" DoCmd.OpenForm "TableChooser", acNormal, , , acFormPropertySettings, acDialog, "" If...
  5. J

    combo box automatically populate with all available tablesin DB

    I've heard (and seen) that it's also possible to populate the combo box with all available table names using an SQL script. (Which isn't to say that your method isn't preferrable... it works great! But I'm interested in SQL scripts, too. For example, I've seen advice from Pat that says to...
  6. J

    Can you set RecordSource to Null?

    Fizzio: The many tables with same fields (and different data) are created at different times. Perhaps monthly. And it is important to keep the tables separated, as they apply to different groupings. But it is also important to be able to apply them to the same report (though not...
  7. J

    combo box automatically populate with all available tablesin DB

    Thanks. I knew I had to add another <> (which means Not, correct?) and an And (which means And, correct?) ...I'm still learning VB, on the fly, and the order of operators, etc...
  8. J

    combo box automatically populate with all available tablesin DB

    It worked! Thanks! I realize that this is the part of the code that includes and excludes certain tables: For Each tbl In cat.Tables If Left(tbl.Name, 4) <> "MSys" Then str = str & ";" & tbl.Name End If Next How would I exclude a specific table (like tblObjectTypeCodes) from the list?
  9. J

    combo box automatically populate with all available tablesin DB

    Well, the error was probably due to the fact that a combo box doesn't use RecordSource, it uses ControlSource. So I changed that little bit and it compiled. Forms!TableChooser!ComboChooser.ControlSource = Right(str, Len(str) - 1) Still, the combo box isn't populating with the list of tables.
  10. J

    combo box automatically populate with all available tablesin DB

    OK, I think I figured out how to call another procedure. I my case, in the Form's Open procedure, I used: Tables.Gettablenames (where Tables is my module and Gettablenames is your sub-procedure) Now there is an error upon compilation: Run-Time Error 438: Object doesn't support this property or...
  11. J

    combo box automatically populate with all available tablesin DB

    dcx693, Of course. ...I've never called another procedure from within a procedure before. What's the process? :)
  12. J

    combo box automatically populate with all available tablesin DB

    Wow, thanks for all the assistance, dcx693. As advised, I created a module (how does Access know to look here though?). I named it "Tables." Then, as you suspected, it gave me the "Not Defined" error, so I checked the "Microsoft ADO Ext 2.5 for DDL and Security" and continued. I also...
  13. J

    combo box automatically populate with all available tablesin DB

    Access 2000, I think. Yeah: v9.0.6926 SP-3
  14. J

    combo box automatically populate with all available tablesin DB

    Thanks! Only thing, dcx693, is that I have no idear what DAO and ADO are. So, in the mean time while I'm looking at the thread WayneRyan suggested, can you get back on those DAO and ADO things, please?
  15. J

    combo box automatically populate with all available tablesin DB

    Is is possible to have a combo box automatically populate itself with the names of all available tables in the database? I would bet this is either really easy or really difficult.
  16. J

    Can you set RecordSource to Null?

    WayneRyan: My report needs a variable RecordSource because my users will be using the same exact report with different tables of data. (These different tables of data will have the same columns/fields.) Re-using a report for different tables, etc... And I don't want them to have to go into the...
  17. J

    Can you set RecordSource to Null?

    Thanks for the advice, dcx693, but: RecordSource = "" does not work... Private Sub Report_Open(Cancel As Integer) RecordSource = "" DoCmd.OpenForm "TableChooser", acNormal, , , acFormPropertySettings, acDialog, "" If IsNull(RecordSource) Then DoCmd.Close acReport, Report, ...
  18. J

    Can you set RecordSource to Null?

    Ah! It seems a simple "End" will do it! If RecordSource = "DefaultSource" Then MsgBox "Focus returned to the report with Default Value" End End If What I did was set my Report's RecordSource to "DefaultValue" (which is not a table I have in my database). Then after the user clicks Cancel on...
  19. J

    Can you set RecordSource to Null?

    Actually, it seems that a Report's RecordSource is normally saved (like every other Property variable) when you save the Report. My problem is that I want to have the user select the RecordSource each time the Report is run. I'm using a modal Form do have the user enter the data. The form has an...
  20. J

    Can you set RecordSource to Null?

    I've noticed that a Report will re-use the value of RecordSource from its previous run. I want to avoid this by setting the value of RecordSource to Null when the Reports opens (and have a user enter a different value). I need to set it to Null because if the user cancels the option to enter a...
Back
Top Bottom