Is it possible for an image control to change to a different picture on a form when focus changes to a different record on a subform? I am developing a simple database to record my ever growing collection of TV shows. The form that I use to view my TV show records has an image control on it, I previously had a single image for the entire series (box art for first season). I now want that image control to change to a different picture when the focus changes to a different record on the subform. i.e. when the focus changes from the first season on the subform to the second season; the picture on the main form changes with it.
I have 3 tables made up of ID and NAME and other parameters. NAME is unique field in each table, whilst ID is not unique. the three tables share the same fields, but can't be combined due to the NAME field not being unique throughout.
Now I have a single table that has a unique ID so I want to make a 1-inf relationship between this table and all three. the problem is how do I look at all three tables at the same time instead of having to insert subdatasheet on only one table.
I have a form with 2 tabs and a sub form on each of those tabs. form1, subformA, subformB on tab control - tabctrl - pageA, pageB. How can i set focus from one tab to another without actually clicking the tab?
I tried this:
TabCtl.Pages("page2").SetFocus
It's comming up with an error - "object required"
I also tried:
page.2.setfocus and that's comming up with an error that it's wrong syntax.
I also tried:
formMyForm.page2.setfocus and that says object required as well.
no problem about setting a different border color for a single textbox (or combobox or listbox) which has focus. How about to change, with a small and fast VBA code avoiding to write code for each textbox, the border color (ora other textbox properties) for a many controls in a form?
I tried using 'For each ctrl in Form....', but I got only bad results. All my control are within differente pages in TAB control.
I'm using a label as a button so it looks nicer, but if I press it without officially exiting the last text field I was in, then that text field doesn't update, so the vba believes it's blank or whatever it was.
I could manually setfocus to a couple different fields or have a teeny field thats hard to see to set focus to, but these both seem roundabout.
I have an unbound form with a combobox which needs to be validated before the control is updated.In the Before Update event I check that the value is valid and need to reset the value back to the previous value if not valid and then change focus to another control.I thought that the following code would work but the selected value remains in the control and I cannot move the focus to another control.
Code: Private Sub cboYears_BeforeUpdate(Cancel As Integer) Dim dteNewDate As Date dteNewDate = DateSerial(Val(Me.cboYears), Month(Me.txtCalendarHeading), 1)
I have 4 nested forms: DataEntryMaster DataEntryMainSub (subform on DataEntryMaster) DataEntrySub2 (subform on DataEntryMainSub) DataEntrySub3(subform on DataEntrySub2)
In the AfterUpdate even of DataEntrySub2, I have code that checks to make sure the field on DataEntrySub3 (it has only one field) has been filled in. If not, I want to set the focus to DataEntrySub3.
The code in the DataEntrySub2 afterupdate event: if isnull(me!dataentrysub3.productbarcode then msgbox "You must enter a product barcode!" forms!dataentrymaster!dataentrymainsubform!setfocu s forms!dataentrymaster!dataentrymainsubform!dataent rysub2.setfocus forms!dataentrymaster!dataentrymainsubform!dataent rysub2!dataentrysub3.setfocus end if
I've used this most-wordy syntax because I couldn't get the shorter syntax (eg, me.dataentrysub3.setfocus) to work at all. However, this STILL doesn't work.
What's really puzzling is that if I run those exact same 3 setfocus statements from the immediate pane, they work fine. But in the afterupdate event, my focus always ends up on a control in dataentrysub2.
Well, the title says it all really. After I click into the subform and type something in a text box, the focus will not return to the parent form, via mouse or tab. I can't even switch the form back into design view, it appears to be totally locked. Has anyone run into this before?
i won't go into details except i am doing databases for cemeteries - very complicated example i have come across two people who have the same name, date of death, buried in the same grave on the same day but are not related and must have seperate records!! my main table has 6 primary keys. [even then i have 2 duplicates who are not related] anyway one of the problems is this i have a main form with 2 subforms. the main form is unbounded. i need to copy information from 1 of 4 queries run by the main form [QBF] to one of the subforms. i don't know which query untill i view the data. when i know which one, i press a command button which copies the information to one of the subforms. when i repeat the actions above instead on the new query data going into a new record on the subform it overwrites the existing data instead of pasting it into a new record. i have tried setfocus command - this works only if i click on the subform and activate it [this defeats the object of the command as i might just as well click in a new record box on the subform]. in essence i do not need to activate this subform at all. i just need to check if a record exists and if it does goto a new record [again this works only if i physically click on the form] any ideas how i can force the cursor to goto a new record without physically clicking on the subform??
If i open a form with a sub form on can i open it so that the focus go directly to a control on a sub form.I have tried to do it with a macro on the on open event to go to control but it comes up that the control don't exists on the sub form.i am using access 2010.
When I click on my subform after entering some data in the primary form, I get this error message:
"The Microsoft Jet database engine can't find a record in the table <name> with key matching field(s) <name>. (Error 3101)"
This is because I have not filled in a ItemCode, a combobox, on the parent form and ItemCode is part of a one-to-many relationship that involves automatic filling in of other fields such as ItemDesc, UnitPrice, etc. How do I code the validation that handles such an error?
I have a single main form with a datasheet subform. When I scroll through the records shon in the main form, each has a different set of child records shown in the subform.
I want the focus to be on the last record of the subform each time.
On the main form, I have a button and this code
Code: Private Sub cmdLast_Click() Me.frmRevisionsSub.Requery Me.frmRevisionsSub.SetFocus Me.frmRevisionsSub.Form.txtRevTag.SetFocus DoCmd.GoToRecord , , acLast End Sub
which works perfectly, when I click the button.
If I call this code from main form's OnCurrent, focus remains on the first line of the subform instead of going to the the last. I have an inkling that it has to do with when the requery of the subform takes place, when I scroll through the records on the main form.
I have a form with a subform which is sized to show several records at the same time. If Record A has the focus, and I click anywhere in Record B, then Record B gets the focus, as expected. ... Except if I click on an Image field in Record B, when the focus stays on Record A.
How I can force it to set the focus to the other record ? I don't think this can be done with Events handlers, as they need to have the focus set first.
I have a form that I created that has a tab control. When the form loads, it automatically sets the focus to a field in the subform. This wouldn't be a problem, except when it does it hides the tabs at the top of the form so I have to go and scroll back up every time I click a tab so that I can see the tabs. Is there a way to adjust this? I have tried hiding a field and setting the focus to it and that didn't work. I also tried setting the focus to the actual tab, but that also did not work.
I am trying to highligh a subform textbox a yellow color on focus. However it is highlighting every textbox in that field as it is a continuous form therefore they are all named ThisCount.
Is there a way to highlight just the specific textbox that I am in. I have tried.
Code: Dim ctlCurrentControl As Control Dim strControlName As String Set ctlCurrentControl = Screen.ActiveControl strControlName = ctlCurrentControl.Name Set ctlCurrentControl = Screen.ActiveControl
I am currently stuck on set focus property. I have a main from with nested subform. I am trying to move the focus from last field of the subform to another field on the main form.
Now I have a field name [Securedesign] in frmOrderdetails and I want the tab order to navigate to field [CustomerID] in frmAddresses which is a subform to frmCustomers.
I have a mainform (f1) and a subform (f2). The subform normally is not visible ([Fomrs]![f1]![f2].visible = Fasle). When I click on a command button on the main form, the subform wiill show up on the main form ([Fomrs]![f1]![f2].visible = True). There is another command button on the subform. When I click on the button, it opens up a third form (f3). The relationship between f1 and f2 is master-child, and the relationship between f2 and f3 is also master-child.
After I open the third form, I want to close (hide) the subform (f2), but I got an error saying that I can not "hide an object that is in focus".
Another one I'm struggling with. I have a mainform and a subform. What I want to achive is : click on a lable (lab1) in the mainform and set the recordsource ( query1 ) in the subform to display relevant data. Click on a lable ( lab2) in the mainform and set the recordsouce (query2) having different data than query1 in the subform.
I have a main form with a control that can take one of three values. And I would like to add a subform that work as follows.
Selecting each value should change what the subform displays like this. Control Subform A Select * from TableA where Key = "A" B Select * from TableB where Key = "B" C Disable subform somehow because it doesn't apply
Could someone please provide some advice on how I could do this.
A user recently made a change to a table in an Access 2000 db (I know, but I’m a volunteer and the org’s a nonprofit that insisted on access to the tables, etc). First he copied the table and renamed it ("basicdata--orig"), then made the change to the copy and gave it the name of the original table ("basicdata"). This table is filled by entries in a form that also has several subforms that create records in linked tables.
Data entered into the main entry form are correctly inserted in the new table ("basicdata"). Data entered in the SUBforms, however, now cause an error stating that the data cannot be saved because no corresponding record exists in "basicdata--orig" (the table that was replaced). Apparently, the main form retained the linkage to the table NAME "basicdata", but the subforms somehow followed the original table's NAME CHANGE and are now looking to it for the corresponding records. Of course, the records are not there.
1) I'd like to understand just what went on here and 2) I cannot find any refence to "basicdata--orig" in the properties of the subforms so I don't know what to change to correct the problem. I realize I could correct it by switching the table names back again, but that action would necessitate some reentry of data that I'd like to avoid.
I know this is probably as clear as mud, but if anyone has followed it and has some answers, I'd sure appreciate hearing them. Thanks!