|
|
in form- drop down and controlled date
Hi there
I am creating a form and I have 2 questions....
1. I have created a combo drop down box using the wizard. It lists the
customer with the customer code beside it all in one box- it pulls the data
from 2 different columns in a table. When one enters the data it only will
allow it to record the customer, but I want it to record the customer and
customer code in different columns... in a different table along with other
data entered for the request.
How do I get it to record both of them?
2. In the same form I have places for the dates to be entered, date the
request was made, date the 1st attempt to fulfill it, date when 2nd attempt
was made, date when 3rd attempt was made, date when 4th attempt was made and
date request completed. I want to make sure the dates entered are equal to
or greater then the previous date entered. But the 2nd, 3rd & 4th attempt
most likely won't be used each time.
How do I do this?
--
Thank-you!
Ruth
|
|
0
|
|
|
|
Reply
|
Utf
|
12/3/2007 7:53:00 PM |
|
Item 1
In the Afterupdate event of the dropdown box code the following:
me.customercodecolumnnameinyourform = me.dropdownboxname.column(1)
All the fields of data returned in a combo box are accessible via
that .column() mechanism.
A dropdown box can return as many columns of info that you want.
The bound column # tells it which one to save
The number of columns field says how many columns are being returned.
The column widths tells access how wide each column should be and can
be 0 (so it doesn't show but is accessable) - separated by semicolon.
The tricky part is that when addressing those columns - The
first column is column(0) - the next is column(1) - etc.
Item 2
In the afterupdate event of each successive date field place something
like
For instance on Date2 place
a) if not isnull(me.date3) or not isnull(me.date4) then
msgbox "This date cannot be erased because there are other
dates"
docmd.cancelevent
else not isnull(me.date2) then
if me.date1 < me.date2 then
msgbox "2nd attempt date CANNOT be less than 1st
attempt."
docmd.cancelevent
endif
endif
Ron
|
|
0
|
|
|
|
Reply
|
Ron2006
|
12/3/2007 8:25:36 PM
|
|
Hi Ron
I am lost...
For the first one I put:
me.customer=me.customer.column(1):me.customercode=me.customercode.column(2)
it states that "The macro (or its macro group) doesn't exist, or the macro
is new but hasn't been saved.
Note that when you enter the macrogroupname macroname syntax in an argument,
you must specify the name the macro's group was last saved under."
The second one I put:
If Not IsNull(Me.2nd attempt) Or Not IsNull(Me.3rd attempt) Or Not
IsNull(Me.4th attempt)Or Not IsNull(Me.completed)Then
MsgBox "This date cannot be erased because there are other"
dates ""
DoCmd.CancelEvent
else not isnull(me.1st Attempt) then
If Me.request date < Me.1st attempt Then
MsgBox "1st attempt date CANNOT be less than request date"
attempt."
DoCmd.CancelEvent
End If
End If
And there is a syntax error in the first line.
--
Thank-you!
Ruth
"Ron2006" wrote:
> Item 1
>
> In the Afterupdate event of the dropdown box code the following:
>
> me.customercodecolumnnameinyourform = me.dropdownboxname.column(1)
>
>
> All the fields of data returned in a combo box are accessible via
> that .column() mechanism.
> A dropdown box can return as many columns of info that you want.
> The bound column # tells it which one to save
> The number of columns field says how many columns are being returned.
> The column widths tells access how wide each column should be and can
> be 0 (so it doesn't show but is accessable) - separated by semicolon.
> The tricky part is that when addressing those columns - The
> first column is column(0) - the next is column(1) - etc.
>
> Item 2
>
> In the afterupdate event of each successive date field place something
> like
>
> For instance on Date2 place
> a) if not isnull(me.date3) or not isnull(me.date4) then
> msgbox "This date cannot be erased because there are other
> dates"
> docmd.cancelevent
> else not isnull(me.date2) then
> if me.date1 < me.date2 then
> msgbox "2nd attempt date CANNOT be less than 1st
> attempt."
> docmd.cancelevent
> endif
> endif
>
>
>
> Ron
>
|
|
0
|
|
|
|
Reply
|
Utf
|
12/4/2007 3:19:05 PM
|
|
On Dec 4, 8:19 am, Ruth <R...@discussions.microsoft.com> wrote:
> Hi Ron
>
> I am lost...
>
> For the first one I put:
>
> me.customer=me.customer.column(1):me.customercode=me.customercode.column(2)
>
> it states that "The macro (or its macro group) doesn't exist, or the macro
> is new but hasn't been saved.
> Note that when you enter the macrogroupname macroname syntax in an argument,
> you must specify the name the macro's group was last saved under."
The above lines should be in code not as a macro line.
In the AFTERUPDATE Event Press the little button to the right (...
button) and select that you want to create code. then put
me.customer=me.customer.column(1)
me.customercode=me.customercode.column(2)
(the above line seems wrong to me. you are moving it to itself).
>
> The second one I put:
>
> If Not IsNull(Me.2nd attempt) Or Not IsNull(Me.3rd attempt) Or Not
> IsNull(Me.4th attempt)Or Not IsNull(Me.completed)Then
> MsgBox "This date cannot be erased because there are other"
> dates ""
> DoCmd.CancelEvent
> else not isnull(me.1st Attempt) then
> If Me.request date < Me.1st attempt Then
> MsgBox "1st attempt date CANNOT be less than request date"
> attempt."
> DoCmd.CancelEvent
> End If
> End If
>
Item 2
Assuming that the first two lines below are actually all one line AND
that the names you are supplying here are example names (because the
space in the middle of the name will not work in code, then what is
incorrect is that
it should read ELSEIF -
If Not IsNull(Me.2nd attempt) Or Not IsNull(Me.3rd attempt) Or Not
IsNull(Me.4th attempt)Or Not IsNull(Me.completed)Then
MsgBox "This date cannot be erased because there are other"
dates ""
DoCmd.CancelEvent
elseIF not isnull(me.1st Attempt) then
If Me.request date < Me.1st attempt Then
MsgBox "1st attempt date CANNOT be less than request
date"
attempt."
DoCmd.CancelEvent
End If
End If
> And there is a syntax error in the first line.
>
|
|
0
|
|
|
|
Reply
|
Ron2006
|
12/6/2007 12:58:41 PM
|
|
OOPS. I hit the enter and send by mistake.
The elseif was my mistake in what I told you.
I believe you could put it as elseif not etc
or as
else
if not etc. ' on two lines but you will then need another
endif
Ron
|
|
0
|
|
|
|
Reply
|
Ron2006
|
12/6/2007 1:01:58 PM
|
|
oops I hit the tab and enter my mistake.
I also made a mistake in the example I sent you.
The ELSE should either be ELSEIF not etc....
or
ELSE
IF not etc........... but if you do it this way you will need
another endif.
Ron
|
|
0
|
|
|
|
Reply
|
Ron2006
|
12/6/2007 1:05:03 PM
|
|
Thank-you for your help! It works now.
--
Thank-you!
Ruth
"Ron2006" wrote:
> OOPS. I hit the enter and send by mistake.
>
> The elseif was my mistake in what I told you.
>
> I believe you could put it as elseif not etc
>
> or as
>
> else
> if not etc. ' on two lines but you will then need another
> endif
>
> Ron
>
|
|
0
|
|
|
|
Reply
|
Utf
|
12/6/2007 7:32:07 PM
|
|
|
6 Replies
167 Views
(page loaded in 0.167 seconds)
Similiar Articles: Date form field in Word - microsoft.public.word.docmanagement ...I've created a form using the drop-down date field. However, after saving and restricting ... You cannot Tab from a content control to a field in Word. -- Stefan ... Formatting NULL values in Drop-Down control - microsoft.public ...I have a drop-down control that is being populated by an entire ... not occur when a value changes in a calculated control. ... 06:45 PM: On Form Load Event and on Drop-Down ... Microsoft date and time picker control - microsoft.public.excel ...The drop down calendars i have created continue to lose their ... The Date/Time Picker ActiveX control is on a form and works in Access 2000. Multiple Select Drop Down Form Field - microsoft.public.word.vba ...Hello, I'm not a programmer, but I am trying to create a form that has a drop -down list where users could press control and select multiple entr... Excel date / time picker control - microsoft.public.excel ...At the moment my form comes up with all the dates blank, as ... Microsoft date and time picker control - microsoft.public.excel ... The drop down calendars i have ... filter combo drop down menu - microsoft.public.access.forms ...I want to filter the drop down menu of [combo B] with the value of [control A]. ... Date field to filter combo list ... Microsoft Answers I created a Drop Down menu in a form ... The Protect Document drop down list is greyed out. - microsoft ...Went into the Control field and Properties is greyed out also. How or what ... Drop Down list will not choose Yes in protected 2007 form ... Drop Down list will not ... HELP! Drop Down missing information - microsoft.public.access ...The main one is a drop down which is a search and ... of information :File Nbr, Customer, Date ... I have created a form that uses several drop down fields. how do I use a dropdown list to update other fields on my form ...Then put textboxes on the form with control sources like =comboboxname.Column(n ... Insert form fields, for example a check box and drop down list, into a form in Word 2003. ... Form and default dates - microsoft.public.accessI've created a form using the drop-down date field. However, after saving ... Dates in subform - microsoft.public.access.forms Jubiiab - The default date format is controlled ... Add the Date Picker control to Word 2007 forms | TechRepublic... control, you can make it easy for customers to enter dates in your forms. ... for the end of next month, click the Project End Date Date Picker control, click the drop-down ... Cut & Paste Drop Down Date selectClick here to get free JavaScripts, hassle free! ... Description: This script displays the current date inside a form via 3 prefilled drop down menus (day, month, year). drop down list to control date picker - InfoPath DevHaving trouble finding a blog or post that answers your question? Check out our Custom Search Page drop down list to control date picker Adding a Date Picker control to a Form in Word... to add a Date Picker Control to a form. The Date Picker Control allows the user to select a date from a pop-up calendar. When the user click in the date field a drop-down ... Create forms that users complete or print in Word - Word - Office.comCreate forms with drop-down lists, check boxes, or date picker pop-ups in Word 2010. ... group, click the Combo Box Content Control or Drop-Down List Content Control. 7/18/2012 12:32:58 AM
|
|
|
|
|
|
|
|
|