Search results

  1. A

    Locking a field after data entry

    Hello Glen. I think your problem is being caused by zero length strings (""). They have no characters but are not considered Null. The code below should do it. Private Sub Form_Current() Dim bolBaselineDate As Boolean bolBaselineDate = IIf(Nz(Me.txtBaselineDate, "") = "", False, True) If...
  2. A

    Navigate between controls

    Hi. You can set the arrow keys behavior for the entire application by selecting Tools>Options and going to the 'Keyboard' tab. If you're looking to change its behavior in just that form, you can do it by setting the property during the Activate and Deactivate events. Private Sub Form_Activate()...
  3. A

    Saving Form Field Properties

    I've never tried this myself, but here's an idea. Create a table to store the properties you want to set for your form. Then, when the VBA code sets the properties on the form, have it also update the table. Code the forms OnOpen event to set the properties based on that table and you should be...
  4. A

    Input mask on Input box

    Hello Charity. I agree with Rich. For a password mask on an InputBox, a form is the simplest method. However, if you'd like I can email you a sample database in Access 97. It contains a password dialog form and a function I wrote called InputForm that works basically the same as InputBox but...
  5. A

    Button examples -ABBY

    John, Sorry, I've been having problems with Hotmail dropping attachments lately. I'll resend. For future reference, this sort of request is best made via email so we don't clog the list with posts only you or I care about. Best Wishes, ~Abby
  6. A

    Conditional Formatting when Record is Selected

    I've emailed you the example databese. Hope it helps. ~Abby
  7. A

    Print of certain text when when conditions is correct

    Hi Rajput. Glad to be of service. I'm not sure I fully understand your criteria. But, I think this source might be it: =IIf([Type] In ("B","T") And [StickerExpiryDate] Between DateAdd("yyyy",1,DateAdd("d",-1,[StickerDateOfIssue])) And DateAdd("yyyy",5,DateAdd("d",-1,[StickerDateOfIssue])),"Some...
  8. A

    Conditional Formatting when Record is Selected

    Hi Rosebud. If I understand your question properly then this link my help you out. It details how to change the background of the selected record in a continuous form and even includes a sample database. Hope it helps http://www.mvps.org/access/forms/frm0047.htm ~Abby
  9. A

    Print of certain text when when conditions is correct

    Hi Rajput. Create a text control with the following as the source and you should be good to go. =IIf(InStr(1,[type],"T")>0 And [DateField] Between DateAdd("yyyy",-10,Date()) And Date(),"Some text","") Good luck. ~Abby
  10. A

    Update Combo Box

    I'm glad to help. To update the form you do basically the same thing you did for the combo box. Here: Forms![FirstForm].Requery This will update the form and all the controls on it. So, you don't need the old line of code and can replace it with this one. However, requerying the form will also...
  11. A

    Toggle YES/NO state HELP .......pse

    I deleted my last post because I misread your response and the information it contained wasn't really of much value and could lead to some confusion. Anyway, if you code the forms 'OnLoad' event with the same code you used in the 'AfterUpdate' of the control that will take care of the vanishing...
  12. A

    Update Combo Box

    Greetings Geno. Here's what you do. Code the data entry form's 'OnClose' event with the code below. Forms![FirstForm].ComboName.Requery Of course you'll need to replace 'FirstForm' with the name of the form containing the combo box and replace 'ComboName' with the name of the combo box. You may...
  13. A

    Toggle YES/NO state HELP .......pse

    I did something very similar just last week. I did it by setting the caption property with the 'AfterUpdate' event. I used 'AfterUpdate' in case the user uses tab and the space bar to activate the toggle. Anyway here's the code that should do what you're looking for. Private Sub...
  14. A

    Refresh/Requery Form

    Sorry, I've never been able to come up with a good solution for that one. I've had the code shift the focus back 5 or 10 records after the find and then move forward again. That works sometimes, but its not a great solution. So, if you find a good one let me know! ~Abby
  15. A

    Refresh/Requery Form

    Hello Rosebud. I had the same problem not long ago. Here's how I solved it. Perhaps you can adapt my solution to your problem. The field 'PartNum' is the primary key for my source table. Private Sub cmdEditDetails_Click() Dim strItem As String strItem = Me.PartNum 'Some code to update the data...
  16. A

    Putting the same data on different field

    Ah, ok. This should do it. For Field1 'AfterUpdate' Me.Field2 = CDate(Left(Me.Field1, 2) & "/" & Mid(Me.Field1, 3, 2) & "/" & Right(Me.Field1, 2)) For Field2 'AfterUpdate' Me.Field1 = Format(Me.Field2, "ddmmyy") Sorry any inconvenience. ~Abby
  17. A

    Putting the same data on different field

    Hello. What you’re trying to do is fairly simple. For clarity I'll refer to the text field as Field1 and the date field as Field2. When using the code that follows, change them to the actual field names (of course). Code the following in Field1's 'AfterUpdate' event. Me.Field2 = Me.Field1...
  18. A

    RecordSet, Find, Easy and Simple??? Help :)

    Looks like you get two replies for the price of one, as Chris hadn't posted when I started writing this. :-) Hi Randix. You're very close. I only see 2 minor errors with your code. First is the WHERE statement. The criteria needs to be dynamic and enclosed in apostrophes. This code should do...
  19. A

    Using code in a query

    Hello Nelmo. If you don't want to code a new function, you can solve you problem with what I call a cascading IIF statement. (I don't know if that's the real name for this. That's just what I call it.) It works by using an IIF statement as the result of another IIF statement. Below is an...
  20. A

    Code question

    Ah. I hadn't realized you were working in a subform. Luckily, if you omit the object type and name then the GoToRecord method will assume you want to manipulate the current object, which of course we do. So this code should do it. If Me.secondfield > 15 Then DoCmd.GoToRecord , , acNewRec...
Back
Top Bottom