Search results

  1. A

    conditional formatting

    [Form].OnCurrent If Me![FieldName]<0 Then Me![FieldName].Forecolor = 16777215 Else Me![FieldName].Forecolor = 0 This works in the test I ran.
  2. A

    calculated fields are not saved in the tables, is there a way to break that rule.

    Rules are made to be broken, although you should always be sure that you really want be an outlaw. In your case the consequences probably aren't too bad. Here's an example. Field1 Field2 TotalField Field2.AfterUpdate Me!TotalField = Me!Field1 + Me!Field2 Assumes these are all numeric data...
  3. A

    Subform.

    You can add a button on the main form to either bring up a new form to add a record or to change the AllowAdditions property of the subform to True. But, as you say, you can't have a clean form and no additions by default.
  4. A

    is there a way to restrict tab on a field that is empty?

    Set the [CommandButton] Enabled property to No. Make sure the Tab Order for the form is set so that the cursor is in [Field] when the form opens. Then put this code in the OnExit property for [Field]: Iif(Not IsNull(Me![Field]), Me![CommandButton].Enabled = True, MsgBox "You must fill in this...
  5. A

    Subform.

    Change the form property Allow Additions to No.
  6. A

    Unique values within a combo box

    Go to the query that is the source for the combo box and in the form properties window change Unique Values to Yes.
  7. A

    Extend the Detail Section in a report

    I was told by Microsoft Support that 22" is an absolute limit and that they do not know of a way to extend beyond that. I'd be interested if anyone knows a work-around.
  8. A

    Group Header and Detail Section printing on new page

    While in the design mode, go to View/Sorting and Grouping. Then enter Product Code and change Group Header to Yes. Also change Keep Together to Whole Group. This will keep all of the details on the same page with the relevant Prdocut Code.
  9. A

    Prompting the user to ensure they have printed

    Try this in the OnPrint property of the report: If(MsgBox "Are you sure you have printed?", vbYesNo) = vbYes Then DoCmd.Close
  10. A

    Saving Calculated Field

    Something like this in the LastName.AfterUpdate property would work: Dim strID as string, strMsg as String strMsg = "You must enter both a first name and last name." If Not IsNull(Me!FirstName)And Not IsNull(Me!LastName) And IsNull(Me!CaseID) Then strID = Left([FirstName],1) &...
  11. A

    I get #Name? when assigning Public variable to Control Source of unbound Textfield of

    Add this line after PubstrTest = "TEST": Me!Textfield = PubstrTest Be sure that [Textfield] is the actual name of the field. You can't assign a variable as a Control Source, but you can set the variable as a field's value when opening a report or form.
  12. A

    first form to open another form that finds a record based on first form.

    If you close the first form before opening the second one, the second one can't find the USER ID that was on the first form. Make sure that the order on the command button is 1)open the second form, 2) close the first one.
  13. A

    Mail merging programmatically

    I'm not sure if there is direct function that calls the Merge Wizard, but you should be able to use DoMenuItem to pull it off. Look it up in Help. For the second part, Access wants a carriage return AND a line feed to create line breaks. Try [First Field] & Chr(13) & Chr(10) & [Second Field] etc.
  14. A

    Setting a report in concrete

    I'm not sure if this is the best solution, but it is one that has worked for me. Try showing the report in Print Preview and while in that mode change the Page Setup parameters. Then save and close the Print Preview. For some reason Access remembers these settings when it forgets the ones done...
  15. A

    labels

    It's possible that you have the CanGrow Property set to Yes for one or more fields, and that there will be random records where, for example, an address field takes up more than one line. That will push all of the following rows down one and may drive the final row onto the next page. Check...
  16. A

    Change to red when Payment is Overdue

    In the OnCurrent property for the form, add the following: Iif(Me!DueDate<Date(),Me!DueDate.Forecolor = 255, Me!DueDate.Forecolor = 0) If you want the other fields to appear red as well, you have to add additional statements. Another option would be to add a label on the form with big red...
  17. A

    subform from form

    Two things. First, you were close but but no cigar. Instead of =IIF([fieldB]="",[Forms!].[ReportC]), you want =IIF([fieldB]="",[Forms]![ReportC]) Note the placement of the ! between [Forms] and [ReportC]. Secondly, depending on how you have the field set up, a zero-length string ("") may not be...
  18. A

    Can I have two columns of data on a report???

    Since Access 97, under File/Page Setup there is a tab for columns. Just select the number of columns you want, and tweak the margins to fit.
  19. A

    setfocus method

    I'm not sure if this is a glitch in Access, but I've had the same problem with various other codes using SetFocus. I've gotten around it by using SetFocus on another control first, then going to the control I want: [any other control].SetFocus [txtbox].setfocus Maybe someone else has a...
  20. A

    User-sort

    If you only need simple sorts, here's a solution I've used before. Show the table as a continuous form, with the fields names as buttons in the header. Clicking on the button resets the form record source to a query that sorts for that field, so the user can click on any button and show the...
Back
Top Bottom