UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

> Macro To Use Same Field Information On Next Record, Office 2007    
 
   
razno
post Apr 10 2012, 04:34 AM
Post #1

UtterAccess Addict
Posts: 129



This is stupid questions, but i ma trying to find answer.

I would like combobox value to be same (what user chosed) after user save record and go to new one.
So user sellect exam ID let say 4 and enter a lot new records with students who will participate in exam 4.


And second question:

when user select in that combobox exam ID (let say 4) - i would like to make that data sheet below show only exam 4 students.
So, basicly if entered any value in form ID, i would like split form to show filtered result exam 4 result only.


Sorry for my english...

Thanks you
Go to the top of the page
 
+
 
Start new topic
Replies
missinglinq
post Apr 17 2012, 10:00 PM
Post #2

UtterAccess Ruler
Posts: 2,658



QUOTE (razno @ Apr 17 2012, 05:28 PM) *
...What is best way to integrate counter in that form?

...So, what is best way to show number of student in that exam?


To be honest, I'm a little fuzzy as to exactly what you're doing here, but the 'count' can be determined with the DCount() function. I think you've indicated that Bruce's code

CODE
Me.txtExamDate.DefaultValue = Me.txtExamDate


worked for you, which means that the Field being carried forward is defined as a Number or Autonumber Datatype, so something like

CODE
=DCount("*", "TableOrQueryName", "ExamID = " & Me.YourComboboxName)


in the Control Source for the 'counter' Textbox should work.

You notice that I said that your Test ID Field has to be defined as a Number; that's because Bruce's code is only the correct syntax if it is a Number. If you use the same syntax trying to carry forward a Text Field or Date Field using that code it will pop an error. Each type of Field needs its own syntax, unless you use something like this:

CODE
Me.YourControlName.DefaultValue = """" & Me.YourControlName.Value & """"

This code will work regardless of the Datatype involved, Text, Number, Autonumber or DateTime Fields.

Linq ;0)>
Go to the top of the page
 
+

Posts in this topic


Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 21st May 2013 - 05:02 PM