Search results

  1. D

    Runtime error 3021 - no current record

    Thanks for the comment. I did try it as a variant and it didn’t make a difference (still got the error) so I went back to using it as a string. And after doing a little research I noticed that Microsoft also remarks to use it as a string in their Northwind database. Check it out here...
  2. D

    Runtime error 3021 - no current record

    I think I got it working. Dim strBookmark As String If IsNull(Me.[SubformName].Form.SubControlField Then Me.MainFormField.Requery Exit Sub Else strBookmark = Me.[SubformName].Form.Bookmark Me.MainFormField.Requery Me.[SubformName].Form.Requery Me.[SubformName].Form.Bookmark = strBookmark End...
  3. D

    Runtime error 3021 - no current record

    Tried Dim strBookmark As Variant Same error I think I need to use an if statement and only Bookmark and requery the subform IF there are any records in the subform.
  4. D

    Runtime error 3021 - no current record

    Having a little trouble getting this code to work. Using a command button to requery a field on the main form and keep the place in the subform. This works fine if there is a record in the subform, but get an error if there are no records. Dim strBookmark As String strBookmark =...
  5. D

    Update yes/no field with VBA on condition

    WOW - that was simple. I had tried doing that before but forgot to repeat the Execute between the two Updates. This is what I had which didn't work. strSQL = "UPDATE tblCompany SET ChkToDo = 0;" strSQL = "UPDATE tblCompany SET ChkToDo = 1 where CompayNotes = -1;" CurrentDb.Execute strSQL...
  6. D

    Update yes/no field with VBA on condition

    I have a table called tblCompany with 2 Yes/No fields. The first one Called [CompayNotes] is used to determine if the company requires summary notes The second is a temporary holder called [ChkToDo] I have a command button on a form to clear the contents of the [ChkToDo] field using an update...
  7. D

    Runtime error 2118 - on timer event

    Hi Markk The more I think about it, the more I'm leaning toward getting rid of the timer. Thanks for you comments.
  8. D

    Runtime error 2118 - on timer event

    I do have the unbound text box set directly. But it only works when the form initially opens. The text box doesn't update itself while the form is open. And when the user is updating any field in the subform, the runtime error shows up as the field they are working on has not yet been saved...
  9. D

    Runtime error 2118 - on timer event

    I'm using a function that calculates UTC. Details here: http://www.excelfox.com/forum/showthread.php/542-Get-standard-GMT-time-from-the-system-using-vba I use a field called CompanyTimeZone that will display the local time where the company is located...
  10. D

    Runtime error 2118 - on timer event

    I have a main form which I set a timer to requery to an unbound text box called "LocalTime" every 60 seconds Private Sub Form_Load() Me.TimerInterval = 60000 End Sub Private Sub Form_Timer() Me.LocalTime.Requery End Sub This works fine until the user edits something in a subform. I tried to...
  11. D

    Query criteria for combo filter

    Thanks CJ. This got me part of the way. Just had to change both queries to [Forms]![frmSummary].[Form]![cboCustomer] or [Forms]![frmSummary].[Form]![cboCustomer] Is Null [Forms]![frmSummary].[Form]![cboContact] or [Forms]![frmSummary].[Form]![cboContact] Is Null Then when I saved it, the...
  12. D

    Query criteria for combo filter

    I’m having difficulty with the results from a query that that is run from a combo box. This maybe very basic, but just can’t figure it out. There is a form with a few combos with drops downs for customers, contacts, etc... The bound column is 1 which is the ID of the customer, contact, etc...
  13. D

    Requery form ONLY if NEW record is created and not just updated

    This is basically what I did on my third post when I posted back with my solution and considered the matter closed. But when I came back and saw more suggestions, I thought of at least acknowledging the extra effort that RuralGuy was putting into it.
  14. D

    Requery form ONLY if NEW record is created and not just updated

    Thanks for all your efforts on this. Sorry haven't responded sooner - I do not tend to go back to my posts when I get it the issue working. But the next time I have to change something on that form, I'll come back to your suggestions and see if I can make it work with just one form. Just...
  15. D

    Requery form ONLY if NEW record is created and not just updated

    Well I couldn't figure out how to do that. So I tried to use a bookmark approach I found on another thread, but that wasn't working very well either. So instead of trying to get the VBA to work, I kind of copped out and just created a duplicate form. So now if the "New Record" button is...
  16. D

    Requery form ONLY if NEW record is created and not just updated

    I have a subform displaying records in a datasheet. On the main form I have a button that will open a form for data entry. I can put some VBA so that when this data entry form closes, it will requery the subform. Forms![MainForm]![SubformName].Form.Requery However, I also have a...
  17. D

    Cascading Combos - How to show ALL in 2nd box if 1st box is blank

    Well pbaldy, you were right. After spending a couple of hours working on VBA in the GotFocus of the second combo to change it's row source depending if the first combo was null, I finally got it to work. Then came back here to re-post and then the light bulb appeared over my head when I re-read...
  18. D

    Cascading Combos - How to show ALL in 2nd box if 1st box is blank

    Not sure I understand what this does. The combo boxes are unbound. Like the images below. Basically, how can you see the ALL the items in the products combo if the supplier combo is left null.
  19. D

    Cascading Combos - How to show ALL in 2nd box if 1st box is blank

    I have two cascading unbound combo boxes. That is, the second box shows filtered items depending on what the user selected in the first combo. But if the user did not select anything in the first combo, I would like the 2nd combo to show ALL items. I found one example that does this - but it...
  20. D

    Copy row to another sheet with a twist

    Never mind - I just figured it out by adding a small if statement to the start of the Sub. This seems to work but wouldn't mind if you'd take a look at it to see if there may be a problem doing it this way or if there is a better way of doing it. ' check if Competed before running macro If...
Back
Top Bottom