Share via

MS Access Split Form Button Not Working

Anonymous
2016-01-21T21:18:18+00:00

Hi, 

I created a new form and set it to split form, then I added a button and added an onClick event to it. The code is very simple:

Private Sub button_Click()
  DoCmd.Close
End Sub

However this button doesn't work unless the form is not in split form, as soon as i change it to a continuous form or single form the button works. I have another split form that was created a while ago, with all the buttons working fine. 

The new split form i created has nothing on it but the button, and it doesn't work. Any idea why it is like this?

Thank you

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. ScottGem 68,830 Reputation points Volunteer Moderator
    2016-01-22T13:29:50+00:00

    Yes, a Split form is a special animal. I would not expect it to work right if there is no Recordsource and/or no data controls on it. 

    Also I prefer to fully qualify my doCmd.Close statements.

    DoCmd.Close acForm, "formame", acSaveNo

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-01-21T21:34:38+00:00

    Nvm..it seems like there has to be at least one field in the split form for the button to work. Did not know that before

    Was this answer helpful?

    0 comments No comments