Search results

  1. S

    Displaying Columns as Rows

    Rich is correct. The problem is structural. Your database should be designed with three fields in the table: Date Increment Data Then each increment is listed as a record (as opposed to a field) so you can query and list them correctly. You can use a make table query (though it will be...
  2. S

    Multi-Table Query and Calculations

    Your tables must be related for Access to know which record in Table 1 and which in Table 2 to obtain. However, if they are, you could simply write the following as a field in your query: Answer: [Table1Name].[FieldName] - [Table2Name].[FieldName] For the second answer, you could either write...
  3. S

    Combo box query

    Your combo box is receiving all 4 items. To display them, adjust the ColumnCount and ColumnWidths properties. Note: this will only change what is displayed when your combo box is "open" (displaying options for a choice). Once an option is chosen, your combo box will only display the first...
  4. S

    combo box to return a valve in a different field

    That's right, Rich! I gave that answer last week and forgot it this week! The two items are in the same table so simply have both columns load into the combo box, show one and then refer to the other combo box column in the text box. In other words, your text box ControlSource would look...
  5. S

    combo box to return a valve in a different field

    Use the DLookUp function in the AfterUpdate event of the combo box. I encourage you to read through other posts also. This question is one that has been answered a lot lately. You can often find what you are looking for in other people's posts or by doing a search. I hope that helps.
  6. S

    delete record problem

    You can't delete a record in a query. You have to delete it from the underlying table.
  7. S

    Finding a sum total in a query after using an expression

    Easy. Just click on the Totals button (the sigma next to the 'Add Tables' button) and choose "Sum" in the column you wish to add (in your case, "Hours").
  8. S

    getting rid of repeptative records

    Use an IIf statement: FinalAddress: IIf(Nz([PreferredAddress]) = "",[RegularAddress],[PrefferedAddress]) This would create a field named FinalAddress which, if nothing was in the preferred address, would be populated with the regular address.
  9. S

    Multiple Criteria in Search Form

    About a year ago I was in the same boat. Someone spent a whole bunch of time e-mailing me directly about this (creating SQL statements in VBA to use as RecordSources) and I was doing the same thing. "WOW!!!" I am glad to help.
  10. S

    Function to test for existence of record

    I speak from experience: use an Autonumber Primary Key field!! I built a database for people that stored the SSN and therefore used that as primary key (no 2 alike, right?). It is a nightmare. I have since gone back and added Autonumbered PK fields. You don't give anything up - you can still...
  11. S

    Multiple Criteria in Search Form

    I think we're getting there! We need to put the "And" string back in there, even if we need to call it something else. So you would have to add: Dim AddAnd As String 'you could name that anything AddAnd = "" Then, for the 1st through 4th If statements (you said you have 5), put the...
  12. S

    Multiple Criteria in Search Form

    WOW! You ARE having problems! Take a deep breath...*SIGH*...and we'll solve this! As far as your first error message, that was my mistake. As I look over the code that I wrote, I realize I left something out. The statement that should be CREATED should look like: [Payor] Like '*Aetna HMO*'...
  13. S

    Multiple Criteria in Search Form

    You would put the SQL statement as the recordsource for the display form (in other words, display this information). You can do this with the DoCmd.OpenForm command: DoCmd.OpenForm "myDisplayFormName",,mySQL That would open the form with the SQL statement you created. [This message has been...
  14. S

    combo box to update two fields after update

    Exactly Rich. Both will work, but you want to have Access only do the work once, which it does when it populates the Combo Box. To use the DLookUp function in each place makes Access look the information up 3 times (once for the Combo box, once each for the statements). If the data is already in...
  15. S

    Multiple Criteria in Search Form

    LQ - you would place the SQL whereever you want to show the records. For example: Me.ComboBoxName.RowSource = mySQL or Forms!YourFormName!RecordSource = mySQL or Reports!YourReportName!RecordSource = mySQL or Me.ListBoxName.RowSource = mySQL (per my example above, "mySQL" is the variable that...
  16. S

    combo box to update two fields after update

    If I am following you correctly, when you choose the FiscalYear from cmboFY, you want two text boxes to display the FYBeginDate and the FYEndDate for the FY displayed in the combo. Is that right? If so, put the following in the AfterUpdate for cmboFY: Me.txtFYBeginDate = cmboFY.Column(1)...
  17. S

    Inserting Manipulated Text from Form into Table Field

    The reason you are finding this so difficult is that you are duplicating information in a table, which is poor database design. Simply display the complete name on a report or form with: =IIf(Nz([NickName]) = "",[Last Name]& ", " & [First Name],[Last Name]& ", " & [Nickname]) You do not need...
  18. S

    Multiple Criteria in Search Form

    You just need to find the correct SQL statement. Here is a suggestion based on a search of 5 fields ([FirstName],[LastName], [Address],[City],[Zip]) Dim mySql As String Dim And As String And = "" 'This will be added after the first criterion mySql = "SELECT * FROM tblYourTable WHERE " If...
  19. S

    Loop

    In your example, you are comparing the same string value (strFieldValue). If that really is the case, in other words, if, based on one field, you need to change a bunch of fields, simply do the following: Select Case strFieldValue Case "-1" .FDFSetValue "Cigarettes", "X", False .FDFSetValue...
  20. S

    Access Pages

    OK, sorry I didn't figure that out. "Pages" is short for "Data Access Pages" which are used for posting Access information to a web page. If you are not using this for web publishing, I would HIGHLY recommend that you move over and use forms. I did look up under Data Access Pages in the Help...
Back
Top Bottom