By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,491 Members | 858 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,491 IT Pros & Developers. It's quick & easy.

Syntax error trying to populate value & then navigate to another form

P: 13
Hi,
Any help appreciated on this one. I've set up a simple database with 4 tables & 3 forms. The tables link together on a field called "client id" which is the ID in a table called "Clients".
I am trying to write some code behind a button on a form called "Membership & Fee Stats" which navigates to the associated Client record on the Clients form. I was getting an error when clicking the button where the [Membership & Fee Stats].[client id] wasn't populated for some records so need to populate that field with the Client.ID field where it is < 1 (or null). I am now getting a syntax error (unsurprising as I'm a dabbler rather than a programmer!). Any help gratefully received & please excuse my lack of knowledge. Code concerned shown below:

Private Sub Command22_Click()
'Make sure client id field is populated.
Update [Membership & Fee Stats] set _
[Client ID]=clients.id from clients join [membership & fee stats] on _
[membership & fee stats].[Client ID]=clients.id where _
[membership & fee stats].[client id] < 1

DoCmd.OpenForm! "clients", , , _
" [ID] = " & Me![Client ID]


End Sub
Dec 1 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.