Heres a link for just that sort of thing. Its in there somewhere, I have used the same structure for a database that requires sending through the MAPI client and Lotus.
http://www.mvps.org/access/modules/mdl0019.htm
;-)
I am not going to take the credit for this, because i didnt write it, but here it is, im sure Dev Ashish wont mind.
http://www.mvps.org/access/api/api0039.htm
;-)
I am not going to take the credit for this, because i didnt write it, but here it is, im sure Dev Ashish wont mind
;-)
'*************** Code Start ****************
' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
'...
When you use 2 tables, as in a 1 to many relationship, you must first create a record on the 1 side, in this case your main form, then creating a record in the subform will create the related record.
Since both the main form and subform have bound record sets and you are using the...
Yep, It was just a matter of time before I nutted this one out.
Set the DataEntry to Yes,
Set the DefaultView to Single form
Move the text boxes in the detail section into the header section.
Now, in the detail section add a list box based on the same query/table that the form is based on...
Sorry MrNick, scratch that last one, cant have a subform on another form that is set to continuous.
Moving to the bottom of the form using DoCmd statement may have to suffice.
:-(
As Shaun Merrill said earlier, setting the dataentry to yes would be the way to have a new record line to be shown at the top of the form. But since you require the other data there as well, then moving to a new record when the form opens or a button is pressed is the only simple way around...
Go to the On Open event of the form. See the build button at the end of the line (3 dots) click it, build a new event procedure. Add the DoCmd line and setfocus lines in the vb code section.
;)
I use this on a form with a list box and text boxes above each column. This will work for a combo box.
The idea behind this is that when a user types something in a textbox/combo and keeps typing, a list box in the case which I use, filters out everything based on what the user has typed...
I can think of 2 quick ways to resolve this.
1. In the On Open event, put this code in:
DoCmd.GoToRecord , , acNewRec
[WhateverTextBox].SetFocus
OR
2. Put a 'NEW RECORD' button on the form somewhere to do the same thing.
Setting the focus to the first text box where the data...
Use an Active X control called anigif.ocx. Heres a link for d/l and how to register it. Make sure you use regsvr32 as you must register the control on your machine before using it.
http://www.allapi.net/vbexamples/vbexample.php?vbexample=ANIGIF
;)
I would agree, using the OpenArgs would be the way to go. But if you have several values that you need to pass, try using public variables and in the form your opening load the variables into the text boxes/variables in the On Load event. BTW, to simplify your code try this...
In response to setting a 'global' variable in a form, thats not quite the way there. Try setting the the variable in a module first in the general declarations section (at the top) of the module e.g.
Public myVariable as Variant
If you use a button or whatever to call a procedure, then put...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.