cmd button to open form to enter new record

jamierbooth

Registered User.
Local time
Today, 04:02
Joined
Oct 23, 2013
Messages
36
Hi,

I have a main form created from a query (FrmQuerySearchResults) which has a sub-form within, (FrmPresentationsTabular) which I am using to show each presentation to our service made by any given client.

For ease of use, I've removed the navigation buttons and want to replace them with my own command buttons. For appearance, I've changed the properties of the sub-form so that 'allow additions' is set to No. This is so that the list of presentations users see does not show the bottom row as a new record.

I'm trying (using macros) to add a button in the footer of the subform that opens a new form (FrmNewPresentation) which opens to a blank record allowing the user to click button, enter info, hit close.

I'm having all sorts of trouble getting this button to do as its told! So far, I have a macro that has 2 steps, first it opens FrmNewPresentation, then it has action GoToRecord, with record set to New, object type set to Table, object name set to Presentations (the name of my table populating this sub-form).

I realise the problem may be the allow additions property being set to No, so I believe I need to add parts to this Macro that goes to that property and changes it on opening the input form - But I have no idea how to do this. I keep getting a message saying "The object 'Presentations' isn't open.

Any suggestions?
Thanks Jamie.
 
The GoToRecord should refer to the form, not the table.
 
Excellent!! It was easier to fix than I thought then!!

Thanks a lot. :)
 
Although... now for some reason, once the input form has had info put in, when I click close the data is disappearing! I check the table and its not there.

I've read a bit about refreshing and requerying, but it seems the new data is not ending up on the table anyway.... :confused:

I'll deal with refreshing/requerying once I find my data!
 
Can you post the db here?
 
Sorry to sound daft, but do you mean attach my database to a reply?
 
I think the problem is that you don't have customer ID on that form, and referential integrity requires it. By the way, this line:

DoCmd.Save acForm, "FrmNewPresentation"

is saving the form object itself, not the data. The data will save automatically if it can since the form is bound.
 
Thanks. Don't know why my custID was missing - I know it needs it. Must have deleted it when formatting the form or something daft.
Have removed the Save bit. Didn't realise it auto updated records like that.
Have also figured out the requery bit so my new entry appears when closing my input form!! :)
 

Users who are viewing this thread

Back
Top Bottom