Refering To A Control On A Sub Form
Jul 11, 2006
After checking on the validity of data entered in a contol on a sub form using the beforeupdate event focus is moved to a password field on the main form. After entering a valid password I would like the focus to be returned to the control on the subform. How would I do this. There are a number of controls on the subform that would be validated in this way so writing the code once with a variable that holds the name of the referring control would be best.
View Replies
ADVERTISEMENT
Feb 9, 2005
Searching returned too many relationship questions so appols if the answer was staring in my face.
A = big company database (updated monthly by the big cheeses)
B = small "team" database (continually, manually updated by ground level staff)
on the first of the month A is updated
B contains various records from A, but doesn't link in any way (nothing changes when A changes)
I want to change this - I want a query whereby B looks in A, and updates:
1: the balance (how much the customer is in credit or debt)
2: the identifier (a number used to identify customer treatment - e.g 1 - customer is blind, send brail info, 2- customer always pays on time, 5% discount - this changes day in day out)
So lets say, for simplicities sake there are 3 fields in both databases, the 2 above and a number primary key.
How would I do it? bearing in mind both databases are seperate.
(note/edit)
also note I only want to run the query at the start of the month - as reflecting the info of A would result in the data in A+B being 31 days out of date at the end of the month (as opposed to just A)
(useless info :) )
The idea of this is to reinforce integrity in B at the start of the month - ensuring everything is correct, whilst still allowing workers to update the info during the month (allowing me to make sure the highest value debt is worked first)
View 13 Replies
View Related
Nov 11, 2007
So I've been able to link in a table to my orders table. The thing is that my employer needs me to link to two tables. One that holds the tasks that needs to be done. This is completed. Now I need to link the orders table into a version history table with a sub linked table of features related to each version. The problem is that when I link in the version table then when I alter the table and try to access the table view then I can only asign one relation. Is there a way around this?
View 1 Replies
View Related
Aug 1, 2005
I have a custom menu bar that has a couple of menu lists, with a list of five custom commands that i want to run,depending on what is selected.I know you can assign a macro to each command,but is there a way to know which command has been selected.
What i want to do is to have 1 macro that will run several functions depending on what was selected, rather than 1 macro for each button
View 1 Replies
View Related
Mar 15, 2006
Hi All,
Can anybody tell me whether it is possible to use a global variable defined in a vb module as part of the criterea in a query, if not whether there is a work around.
I suppose I could temporarily write the data to a table and use it from there, I thought there would be less messing around this way though.
Cheers
View 2 Replies
View Related
Jun 12, 2007
It is possible to refer in a SQL statement to the "current" or "actual" record?I want to base the querry in the present value of two related tables. I will try to show you what I have to do, maybe you can give an alternative solution.These are the tables:tblTeam (idTeam, TeamName, DayCreated)tblTeamPerson (idPerson, idTeam)tblPerson (idPerson, PersonName, MusicPreference)Every person have a music preference, and the teams have to be formed by people with similar music preference.So, one way to filter that is to use the following method: everytime I create a team, I choose a person, ok. That firts guy is the one that will give the team his "MusicalPreference". The next members with different MusicalPreferences will be excluded from the query.But in order to do that, I need to refer to the current team that have 1 member, and use the value of the field MusicPreference in that Person in particular.I hope you have understand what I have to do, and I hope you can help me with this.P.S.: I´m using a combo-box with a special query in a subform to select the team members. In the main form I create the team. So it would be great to be able to use that "idTeam" value in relation with the firts team member of that team.
View 6 Replies
View Related
May 28, 2015
I have table that I had to add a new field to which we update with a form. I tried to add a control for the new field but the field does not show up in the list for the control source. I am trying to add a list box to the form with a blank and 5 options.
I have attached screen shots of the table design and the form. The table has the field in datasheet view and I have manually entered a few entries in it but it still will not show in the control source for the form control. The top section of the form is where we enter and select the data for the new records. The bottom section (circled in red) autofills the matching record, from separate tables, for updating with the new entries.
I have added form controls for modified fields in the past so I am confused about why this is happening.
View 2 Replies
View Related
Jun 24, 2013
When I right click a row on the data sheet side of a split form an select "New Record" I want the curser to go to the first field on the single record side. I've placed this in the OnCurrent but it did no good.
Code:
If Me.NewRecord Then
Me!Descrfiption.SetFocus.
End If
Any way to set the focus to the single form Side of a split form?
View 4 Replies
View Related
Jun 21, 2013
I have modal form - frmZlecenia
I would like to copy one control, then close this form, open concrete form and pass value to control.
My code is
Private Sub Menu_Click()
DoCmd.OpenForm "frmZleceniaMarzenaNawigacjaPD"
Forms!frmZleceniaMarzenaNawigacjaPD.Form!Imie = Me.Imie
Forms!frmZleceniaMarzenaNawigacjaPD.Form!Imie.SetFocus
DoCmd.Close acForm, Me.name
End Sub
The problem is, still opens the previous form, not form "frmZlecenia"
e.g If I open form x then from this form I open my modal form "frmZlecenia" and then I will click "menu" button - now form "x" is open :/, but should be "frmZleceniaMarzenaNawigacjaPD"
There is some way to open concrete form from modal form?
View 1 Replies
View Related
Sep 11, 2014
I have a data entry form which have a date field.This field retains the existing date after the record is saved with vba after update event.
Private Sub Form_AfterUpdate()
Me.ProductionDate.DefaultValue = Chr(35) & Me.ProductionDate.Value & Chr(35)
End Sub
Almost after a year of perfect working i am facing a problem.When i save the record , in date field my date and month values are reversed if date is between 1-12.although my database stores perfectly valid date. for example if date is "10-09-2014" (dd-mm-yyyy) after saving form date field becomes "09-10-2014". but if date is "13-09-2014" The date form field retains this value .
View 2 Replies
View Related
Jan 14, 2015
On a form I have a:
control called "FilterListBox"
list box called "lstCustomer"
option Box called "optCustomerType"
When the user selects an option in the option box, "FilterListBox" is updated to either "1", "2" or "1 or 2"..One of the fields in the query for "lstCustomer" is "CustomerType" and its criteria is set as follows:
[Forms]![frmPrintHowCustomersPaidInvoice]![FilterListBox]
if "FilterListBox" = 1 the query for "lstCustomer" returns the correct records
if "FilterListBox" = 2 the query for "lstCustomer" returns the correct records
But if "FilterListBox" = 1 or 2, no records are returned.
View 9 Replies
View Related
Dec 26, 2007
I have a form where the user types in a part of a name and then he can view the details of all the people that their name has that string.
But I am having trouble writing the query that will do this...I have tried using:
WHERE fieldname LIKE '*[forms]![formname]![controlname]*'
Hoping that if instead of the string I would give the control that has the string it will work.
But of course that doesnt work (the simple solution never works :o). and I guess that the syntax is different when using a control.
so...
What do I need to Write in order to make it work?
View 2 Replies
View Related
Aug 8, 2005
I have created this form and I want the user to tab thur the fields and when the last field is tabed move to the next (tab) page on the form? How can I make this happen?
View 1 Replies
View Related
Mar 7, 2006
Is it possible to add a control to a form using VB?
What I am trying to do is simulate an unbound continuous sub-form. My idea is when the source of the main form changes, I will query for the sub-form records associated with the new main form data, and insert on to the main form enough subforms for each detail record.
The sticking point is how to add that control to the form.
I've searched the properties and methods of the forms object but found nothing that looks like what I need.
Anyone have any ideas how I can proceed?
Thanks,
David
View 5 Replies
View Related
Mar 5, 2008
hi all, Newbie to access and am making an asset tracking database for work. I have written a sub that opens a hidden form and queries it. I want to get a value from that hidden form and stick it into a combo box on my origianl form. I have got most things to work. The problem i am having is using a variale in a control form i.e. [forms]![ & strVar & ]![Field] here is the code i have so far
Private Sub Form_Search(strFname As String, strField As String, strFField As String, strWhere_Next As String)
Dim strWhere As String
strWhere = strField & " = " & "" & strFField & ""
strWhereA = "[Forms]![" & strWhere_Next & "]![ALLOCATEDTO]"
DoCmd.OpenForm strFname, acNormal, , strWhere, , acHidden
Me.ALLOCATEDTO.Value = strWhereA
DoCmd.Close acForm, strFname
the strWhereA shows the correct field but is shown as [Forms]![Formname]![ALLOCATEDTO] in my combobox, not the actual value of that form. Please help. I know this is probably a simple syntax error but am now at my wits end!!!
Thanks in advance!
View 6 Replies
View Related
Mar 22, 2005
Hi
Here I want to know how can i control the checkBox
when i enter ID in form i got the related feilds too so when i want
to edit the record i wnat to check if the checkBox is TRUE i get
messege that i cant edit this record?
http://lonelymoon2442.jeeran.com/checkBox.JPG
View 5 Replies
View Related
Mar 23, 2005
Hi i want to know how can i control CheckBox
Ex:
http://lonelymoon2442.jeeran.com/cForm.JPG
*- If i have record for and the primiry key is the ID
*- When i type the ID i get the an other data for that record
*- If i change address in that form and the checkBox is True i want to stop update that record and get messege for that.
OR
Checking all address in that Form if it equals to the new address entry Then get Messege.
Why I need it?
I have FORM to Borrowing Books and i don't want any one to Borrow Book two times.
View 1 Replies
View Related
Apr 11, 2005
Hey guys,
a quick question.
I have a form called "FormA"
within that form i have a tab control
and one of the pages is called "Page1"
inside that page1 i have a subform named "subform1"
and finally inside subform1 i have a field named "field"
what would be the correct syntax to reference the value of the field???
been messing with this for awhile and am getting a headace, was hoping someone can help
thanks alot
Ricky
View 2 Replies
View Related
Dec 14, 2005
Hi,
I have just split up a table into tables so that has interfered with the form I had created for it. I have 2 main tables:
tblDrawingRegister:
DrawingNum
DrawingName
tblRevision:
Drawing num
Revision
LatestIssueDate
OrderNum
I split them up because there was alot of dublication. One drawing can have many different revisions. So I think it was better to split it up like this?
Anyways the form allows the user to add this information so some of the controls are bound to one form and the others to another. I know that I could do a query to combine the two tables but is that the best way to do it from an optimisation/ good database design point of view?
From a layout point of view I would prefer not to use a subform.
Thanks for your time,
RCurtin
View 2 Replies
View Related
Jun 9, 2006
Sorry to bother everyone with something that is probably real simple....
I would like to disable one control if another does not equal a certain value.
Do I set the control to enable=No and then use OnCurrent and afterupdate?
As always, I am confused and could use some assistance.
Tim E.
View 2 Replies
View Related
Sep 26, 2006
Hi I have a problem that has been messing my head up. I want to be able to change the way the tab button works in a continuous form, instead of the tab tabbing across/through a single record first I want to be able to tab down/through the fields. I know this may seem strange to some but that is how I would like it to work. I could change the form to something else but that would require too much alteration and make life harder in the long run.
I currently have some VBA code set to ensure that the field that is select on open has a TabStop and all other fields do not. Is this the correct way of doing it or is there an easier way.
http://www.imagestation.com/picture/sraid215/pd61e514836ed9c50e77643aaf787f521/ecc91c25.jpg
Morian
View 2 Replies
View Related
Oct 22, 2004
Hello all,
I am in dire need of Access expertise. Basically, I have a form with many customer records. What I want to accomplish is to have a text box at the bottom of the form whereby I can type in a client's name which would change the record on the form to display that clients information. It would be nice if what I type into the text box doesn't have to match a clients name exactly (maybe use some sort of wildcard?). I have but a clue how to acheive this. Any suggestions would be sincerely appreciated.
View 1 Replies
View Related
Jan 9, 2006
Hello,
does anyone know where I can find some different backgrounds for my forms and controls?
I have Office 2003 and would like to personalize my forms without using the limited colours provided by MS Access.
Thanks.
View 4 Replies
View Related
Sep 11, 2007
I have a database with a 'Projects' table with 148 records. One of the fields is named ‘Current’ (a y/n field). I also have a table named 'Printing' with a lookup field named 'Project' based on the 'Projects' table. I have a data entry form set up based on 'Printing'. The combo box for the 'Project' field on the form is based on a query that finds only projects that are marked as 'current' in the 'Project' table. I've come up with a glitch though - if a record in ‘Printing’ has a project that was current at the time it was entered but subsequently has been marked as non-current, the ‘Project’ control on the form goes blank. The 'project' data remains correct in the ‘Printing’ table, but the form doesn't display it correctly. The form is used as a 'job log' so when a job is logged in, I want the ‘Project’ control pull-down to display only current projects but I also need the form to always display that information no matter what the status of a project. I’ve tried playing with the ‘limit to list’ property with no luck. I’m not a coder at all so please be gentle with me.
View 1 Replies
View Related
May 21, 2015
I am trying to create a form where there will be information entered. The information being entered needs to be on two different pages, as they belong to two different tables. I would like to use the tab control. The problem I am having is that I want to be able to lock the second tab until all of the information on the first tab is correct and the employee entering the information verifies it. Is this possible and if so how?
View 5 Replies
View Related
Jul 25, 2013
I have a form that has many calculated fields(hidden and shown) based on the data in the source table. The calculated values roll up to a textbox(txtAward) that shows an award(Gold,Silver,Bronze) based on the total calculated points.
There is no inputting in the form. Its just used to display what was input and what the final award is.
txtAward isn't part of the source table but can be added.
How can I get the txtAward value into the table so I can do some reporting?
View 2 Replies
View Related