By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,640 Members | 2,094 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,640 IT Pros & Developers. It's quick & easy.

Requery question

100+
P: 158
Hi All,

I've gone through the post and saw many posts similar to what I am looking to solve but haven't been able to get results still.


Here is the setup:

I have a form named WorkOrderF

On this form there is an Unbound combo box called [GototenantCombo]. This combo box lookup a query[WOSourceQ] (my active work orders) and returns the record that I want to work on.

I use a pop up form [NewWorkOrder] to add other customers to [WOSourceQ]

Once I've added a new customer to new customer shows up into the combo box [GoToTenantCombo], everything good so far.

The problem that I have is with the subform WODDescriptionSF inside WorkOrderF form. It is (master and child linked with the ID of the work orders.

The subform WODDescriptionSF get values from [WODSourceQ] and this is the form that needs to be requery.

HOw I have been managing so far is by clicking RefreshAll command on the ribbon but would love to be able to forgo that step.

Can Anyone help?

PS: Does Access 2010 comes with (refresh all) command? I could use that darn command in about 10 modules. why is something so useful still being ignored by MS?
Jan 11 '10 #1

✓ answered by nico5038

I get the impression that your Access installation got corrupted in some way.
The not running of my sample and the XML in the comment are odd.

Please do a repair with the Control panel/Programs tool, or reinstall Office.

Perhaps also advisable to convert all macro's into VBA and stop using a mix of VBA and macro's. Macro's were already advised to ignore in the older versions and VBA gives much more flexibility.

In my version I added the "RemoveFilterSort" command in the afterupdate macro of the tenant combobox, as the popup form does add a filter to make the new recors to show.

Nic;o)

Share this Question
Share on Google+
40 Replies


nico5038
Expert 2.5K+
P: 3,072
For the requery you could use the command "Me.requery" or "Me.subformname.requery" for just the subform.
This line should be added in the code for the AfterUpdate event of the combobox.

When this comand doen't work (Access is stubborn sometimes) I use:
Expand|Select|Wrap|Line Numbers
  1. Me.subform.recordsource = Me.subform.recordsource 
Which looks funny, but does the trick always.

Nic;o)
Jan 11 '10 #2

NeoPa
Expert Mod 15k+
P: 31,487
As Nico says you need to .Requery the form (or all relevant forms). Check out Referring to Items on a Sub-Form for how to refer to one form from another, which will be required if you're doing it from the pop-up form.

PS. Well done for including the names of your objects in the question. So useful, yet often overlooked ;)
Jan 11 '10 #3

100+
P: 158
One thing I forgot to mention - I already use the AfterUpdate of the combobox with a Macro.

More clearly:

My Parent form is [WorkOrderF] it's record source is query [WOSourceQ]

This form has an Unbound Lookup Combobox [GoToTenantCombo] with record source table [TenantT]. It's AfterUpdate has a macro:

SearchForRecord

Object type: Null
Object name: Null
Record: First
Where Condition: ="[TenantID] = " & Str(Nz(Screen.ActiveControl,0))

My parent form has child form(parent&Child Link:[WOID] called [WODDescriptionSF] with record source query [WODSourceQ]

I use a Boolean switch yes/no to determine if the work order is active or not and the criteria for both source queries of the parent and child form.

When I want to introduce a new tenant and work order I use a pop up form[AddNewTenantF] with record source table [WorkOrderT] and a combobox with the following row source:
Expand|Select|Wrap|Line Numbers
  1. SELECT   TenantsT.TenantID,
  2.          [FirstName] & " " & [LastName] & "   -  " & [Unit] & " - " & [Building] AS TenantName
  3.  
  4. FROM     BuildingLT RIGHT JOIN
  5.          (LocationsT RIGHT JOIN
  6.          TenantsT
  7.   ON     LocationsT.LocID=TenantsT.LocID)
  8.   ON     BuildingLT.BuildingID=TenantsT.BuildingID
  9.  
  10. ORDER BY LocationsT.Unit;
this combobox AfterUpdate is:
Expand|Select|Wrap|Line Numbers
  1. Private Sub TenantID_AfterUpdate()
  2.     [Forms]![WorkOrderF]![WODDescriptionSF].[Form].Requery
  3. End Sub
Then I close the popup form and return to my parent form[WorkOrderF] to find the value of the[WorkOrderF].[GoToTenantCombo] combobox to be a random value with random child value as well from [WODDescriptionSF].

I then click RefreshAll button command on the ribbon and may or may not get random values from the [GoToTenantCombo] and the underlining subform.

Once I go to the {GoToTenantCombo] and select a new record that's when everything gets back to normal and everything works.

Cheers
Jan 11 '10 #4

nico5038
Expert 2.5K+
P: 3,072
I would advise to transform your macro's into VBA. Access has an option that enables this.

Next replace the subform requery with:
Me.WODDescriptionS.recordsource = Me.WODDescriptionSF.recordsource

That should do the trick.

Nic;o)
Jan 11 '10 #5

100+
P: 158
Unfortunately it didn't work.

This is the VBA Codes that I have on the popup form to add new work orders:
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2.  
  3. Private Sub TenantID_AfterUpdate()
  4.     [Forms]![WorkOrderF]![WODDescriptionSF].[Form].Requery
  5. End Sub
  6. '------------------------------------------------------------
  7. ' Form_Load
  8. '
  9. '------------------------------------------------------------
  10. Private Sub Form_Load()
  11. On Error GoTo Form_Load_Err
  12.  
  13.     DoCmd.GoToRecord , "", acNewRec
  14.  
  15.  
  16. Form_Load_Exit:
  17.     Exit Sub
  18.  
  19. Form_Load_Err:
  20.     MsgBox Error$
  21.     Resume Form_Load_Exit
  22.  
  23. End Sub
  24.  
  25.  
  26. '------------------------------------------------------------
  27. ' cmdClose_Click
  28. '
  29. '------------------------------------------------------------
  30. Private Sub cmdClose_Click()
  31. On Error GoTo cmdClose_Click_Err
  32.  
  33.     DoCmd.Close , ""
  34.     DoCmd.RunCommand acCmdRefresh
  35.  
  36.  
  37. cmdClose_Click_Exit:
  38.     Exit Sub
  39.  
  40. cmdClose_Click_Err:
  41.     MsgBox Error$
  42.     Resume cmdClose_Click_Exit
  43.  
  44. End Sub
  45.  
  46.  
  47. This is what I have for the parent work order form:
  48.  
  49. Option Compare Database
  50.  
  51. '------------------------------------------------------------
  52. ' GotoTenantCombo_AfterUpdate
  53. '
  54. '------------------------------------------------------------
  55. Private Sub GoToTenantCombo_AfterUpdate()
  56. On Error GoTo GoToTenantCombo_AfterUpdate_Err
  57.  
  58.     DoCmd.SearchForRecord , "", acFirst, "[TenantID] = " & Str(Nz(Screen.ActiveControl, 0))
  59.     DoCmd.RunCommand acCmdRefresh
  60.  
  61. GoToTenantCombo_AfterUpdate_Exit:
  62.     Exit Sub
  63.  
  64. GoToTenantCombo_AfterUpdate_Err:
  65.     MsgBox Error$
  66.     Resume GoToTenantCombo_AfterUpdate_Exit
  67.  
  68. End Sub
  69.  
  70.  
  71. '------------------------------------------------------------
  72. ' AppointmentCmd_Click
  73. '
  74. '------------------------------------------------------------
  75. Private Sub AppointmentCmd_Click()
  76. On Error GoTo AppointmentCmd_Click_Err
  77.  
  78.     On Error Resume Next
  79.     If (Form.Dirty) Then
  80.         DoCmd.RunCommand acCmdSaveRecord
  81.     End If
  82.     If (MacroError.Number <> 0) Then
  83.         Beep
  84.         MsgBox MacroError.Description, vbOKOnly, ""
  85.         Exit Sub
  86.     End If
  87.     On Error GoTo 0
  88.     DoCmd.OpenForm "AppointmentsF", acNormal, "", "[TenantID]=" & Nz(TenantID, 0), , acNormal
  89.     If (Not IsNull(TenantID)) Then
  90.         TempVars.Add "CurrentID", "[TenantID]"
  91.     End If
  92.     If (IsNull(TenantID)) Then
  93.         TempVars.Add "CurrentID", "Nz(DMax(""[tenantID]"",[Form].[RecordSource]),0)"
  94.     End If
  95.     DoCmd.Requery ""
  96.     DoCmd.SearchForRecord , "", acFirst, "[tenantID]=" & TempVars!CurrentID
  97.     TempVars.Remove "CurrentID"
  98.  
  99.  
  100. AppointmentCmd_Click_Exit:
  101.     Exit Sub
  102.  
  103. AppointmentCmd_Click_Err:
  104.     MsgBox Error$
  105.     Resume AppointmentCmd_Click_Exit
  106.  
  107. End Sub
  108.  
  109.  
  110. '------------------------------------------------------------
  111. ' PurchaseOrderCmd_Click
  112. '
  113. '------------------------------------------------------------
  114. Private Sub PurchaseOrderCmd_Click()
  115. On Error GoTo PurchaseOrderCmd_Click_Err
  116.  
  117.     On Error Resume Next
  118.     If (Form.Dirty) Then
  119.         DoCmd.RunCommand acCmdSaveRecord
  120.     End If
  121.     If (MacroError.Number <> 0) Then
  122.         Beep
  123.         MsgBox MacroError.Description, vbOKOnly, ""
  124.         Exit Sub
  125.     End If
  126.     On Error GoTo 0
  127.     DoCmd.OpenForm "PurchaseOrdersF", acNormal, "", "[WOID]=" & Nz(WOID, 0), , acNormal
  128.     If (Not IsNull(WOID)) Then
  129.         TempVars.Add "CurrentID", "[WOID]"
  130.     End If
  131.     If (IsNull(WOID)) Then
  132.         TempVars.Add "CurrentID", "Nz(DMax(""[WOID]"",[Form].[RecordSource]),0)"
  133.     End If
  134.     DoCmd.Requery ""
  135.     DoCmd.SearchForRecord , "", acFirst, "[WOID]=" & TempVars!CurrentID
  136.     TempVars.Remove "CurrentID"
  137.  
  138.  
  139. PurchaseOrderCmd_Click_Exit:
  140.     Exit Sub
  141.  
  142. PurchaseOrderCmd_Click_Err:
  143.     MsgBox Error$
  144.     Resume PurchaseOrderCmd_Click_Exit
  145.  
  146. End Sub
  147.  
  148.  
  149. '------------------------------------------------------------
  150. ' CustomerDetailsaddCmd_Click
  151. '
  152. '------------------------------------------------------------
  153. Private Sub CustomerDetailsaddCmd_Click()
  154. On Error GoTo CustomerDetailsaddCmd_Click_Err
  155.  
  156.     DoCmd.OpenForm "TenantsDetailsF", acNormal, "", "", , acNormal
  157.  
  158.  
  159. CustomerDetailsaddCmd_Click_Exit:
  160.     Exit Sub
  161.  
  162. CustomerDetailsaddCmd_Click_Err:
  163.     MsgBox Error$
  164.     Resume CustomerDetailsaddCmd_Click_Exit
  165.  
  166. End Sub
  167.  
  168.  
  169. '------------------------------------------------------------
  170. ' NewWOCmd_Click
  171. '
  172. '------------------------------------------------------------
  173. Private Sub NewWOCmd_Click()
  174. On Error GoTo NewWOCmd_Click_Err
  175.  
  176.     DoCmd.OpenForm "WOCreateNewF", acNormal, "", "", , acNormal
  177.  
  178.  
  179. NewWOCmd_Click_Exit:
  180.     Exit Sub
  181.  
  182. NewWOCmd_Click_Err:
  183.     MsgBox Error$
  184.     Resume NewWOCmd_Click_Exit
  185.  
  186. End Sub
  187.  
  188.  
  189. '------------------------------------------------------------
  190. ' cmdClose_Click
  191. '
  192. '------------------------------------------------------------
  193. Private Sub cmdClose_Click()
  194. On Error GoTo cmdClose_Click_Err
  195.  
  196.     DoCmd.Close , ""
  197.  
  198.  
  199. cmdClose_Click_Exit:
  200.     Exit Sub
  201.  
  202. cmdClose_Click_Err:
  203.     MsgBox Error$
  204.     Resume cmdClose_Click_Exit
  205.  
  206. End Sub
  207.  
  208.  
  209.  
  210.  
  211. '------------------------------------------------------------
  212. ' workOrderReceiptCmd_Click
  213. '
  214. '------------------------------------------------------------
  215. Private Sub workOrderReceiptCmd_Click()
  216. On Error GoTo workOrderReceiptCmd_Click_Err
  217.  
  218.     DoCmd.OpenReport "WorkOrderReceipt", acViewReport, "", "[TenantID]=" & Nz(TenantID, 0), acNormal
  219.  
  220.  
  221. workOrderReceiptCmd_Click_Exit:
  222.     Exit Sub
  223.  
  224. workOrderReceiptCmd_Click_Err:
  225.     MsgBox Error$
  226.     Resume workOrderReceiptCmd_Click_Exit
  227.  
  228. End Sub
  229.  
  230.  
  231. '------------------------------------------------------------
  232. ' WorkOrderReceiptAppointmentCmd_Click
  233. '
  234. '------------------------------------------------------------
  235. Private Sub WorkOrderReceiptAppointmentCmd_Click()
  236. On Error GoTo WorkOrderReceiptAppointmentCmd_Click_Err
  237.  
  238.     DoCmd.OpenReport "Work Order Receipt Appointment", acViewReport, "", "[TenantID]=" & Nz(TenantID, 0), acNormal
  239.  
  240.  
  241. WorkOrderReceiptAppointmentCmd_Click_Exit:
  242.     Exit Sub
  243.  
  244. WorkOrderReceiptAppointmentCmd_Click_Err:
  245.     MsgBox Error$
  246.     Resume WorkOrderReceiptAppointmentCmd_Click_Exit
  247.  
  248. End Sub
The WODDescriptionSF subform has no codes or macro.
Jan 11 '10 #6

nico5038
Expert 2.5K+
P: 3,072
Try changing:

Expand|Select|Wrap|Line Numbers
  1.  
  2.    3. Private Sub TenantID_AfterUpdate()
  3.    4.     [Forms]![WorkOrderF]![WODDescriptionSF].[Form].Requery
  4.    5. End Sub
  5.  
  6. into
  7.  
  8.    3. Private Sub TenantID_AfterUpdate()
  9.    4.     [Forms]![WorkOrderF]![WODDescriptionSF].[Form].Recordsource = [Forms]![WorkOrderF]![WODDescriptionSF].[Form].Recordsource 
  10.    5. End Sub
  11.  
Nic;o)
Jan 11 '10 #7

100+
P: 158
Sorry.... It still didn't work. Not only that but now the tenants are getting mixed up and somehow some work orders have been assigned to other clients. good chance I backed up the database prior lol.
Jan 11 '10 #8

nico5038
Expert 2.5K+
P: 3,072
Strange, can you post a sample mdb so I can have a look ?

Nic;o)
Jan 11 '10 #9

100+
P: 158
How can I do post a sample MDB?
There are personal information in this MDB, not sure if it would mean my neck if any of these information got out???? not sure if I can do that????
Jan 11 '10 #10

nico5038
Expert 2.5K+
P: 3,072
Just create a new .mdb with just these forms and some fake data. Just enough to show the not working form / pop-up form mechanism.
You can attach a file (just zip the sample) in the advanced mode.

Nic;o)
Jan 12 '10 #11

100+
P: 158
Ok I will try to do that. I will have to see if I have a zip maker; I never done that before. so when I manage to get the sample mdb how do I upload it here? I don't see any mean of doing this??? I;m not all that great with computers, sorry. Also, will I be able to attach a message? explaining what I would like to see happening? This is really awsome, I really appreciate this.
Jan 12 '10 #12

nico5038
Expert 2.5K+
P: 3,072
When you press the button [Go Advanced] below the Quick Reply, you'll get a form with below the textbox a button [Attachments].

For zipping a file (when you have Vista) just select the right-click pop-up and select "Send to -> Compressed(zipped) folder".

Nic;o)
Jan 12 '10 #13

100+
P: 158
OK, thank for the tip Nic;o)

I've been fiddling around and managed to get it close to working...

Everything works! Except one thing that I can't figure out:

the new record won't show on form when selected????????

All the other records work perfectly except the new one that I just added. I double checked in the work order table and its there.... I also check in the query that is my record source for my work order form, it is there also but I still need to click RefreshAll button on the ribbon to make it work.

This is so frustrating... I spent my whole weekend trying to figure this out and tried everything to no avail.

I won't be able to recreate a database with sample data because there are too many relationships that depends on one another and I am getting tons of error messages that I can change anything.
Jan 12 '10 #14

MMcCarthy
Expert Mod 10K+
P: 14,534
You need to save the new record after you add it and before running the code Nico gave you.

Something like ...
Expand|Select|Wrap|Line Numbers
  1. DoCmd.RunCommand acCmdSaveRecord
  2.  
Jan 12 '10 #15

100+
P: 158
Still Not working!!!! ARGGGGGHHHH

Let me ask about DLOOKUP

I saw a video online using a combobox and then writing DLooup line in the after update event. would that make it work for me?

The problem that I still have is when I add a new work order... It shows into the combo box but when I click it, it won't show up on the form. I can tell too by the number of records at the bottom. Once I click RefreshAll button on the Ribbon it then adds it and see the number of record in my form going up 1 record.

Another question relating to this:

I've tried to delete and redo the filter or lookup combo box in my form. When I first created it I had three choice:

1- remember the value for later
2- store the value in a control
3- lookup a value on my form

now that I want to create a new combo box that will lookup I don't get the option #3? why is that?

thanks, Sorry for being such a Goober
Jan 12 '10 #16

nico5038
Expert 2.5K+
P: 3,072
New records often give this type of trouble.
I solve this often in a different way. When the user presses the [New] button I just INSERT a new record and open the form with that newly inserted record. When the user presses [OK] the record is "saved" automatically, but when the user presses [Cancel] I issue a "DELETE".
To keep the ID filled sequentially I use the DMAX() function and thus a deleted record won't give a "gap". So no autonumber, but just my own key.

Idea?

Nic;o)
Jan 12 '10 #17

100+
P: 158
LOL thanks Nic;o).... I mean you have a patience of gold for sticking with me on this. I truly appreciate your efforts...

Let me try one more time:

I have the following to deal with:

Expand|Select|Wrap|Line Numbers
  1. [WorkOrderT] = Table
  2. [WorkSourceQ] = Query
  3. [WorkOrderF] = Parent Form
  4. [GotoTenantCombo] = Unbound lookup Combobox in Line #3
  5.  
  6. [WorkOrderDetailsT] = Table
  7. [WODDescriptionSF] = Child Form for Line #3
  8.  
  9. [WOCreateNewF]=  Popup form to add new records in line #3
  10.  
  11. Line #1 is record source for Line #2
  12. Line #2 is record source for line #3
  13. Line#3 is parent to child for line #7
  14. Line #5 looks up in line#2
  15.  
  16. EVERYBODY IS HAPPY SO FAR
  17.  
  18. Line #9 add a record to line #4
  19. Line #4 shows the new record entered by Line#9
  20. Line #4 Clicks the new record = NOTHING HAPPEN 
  21. User clicks (RefreshAll) on the Ribbon = EVERYBODY IS HAPPY 
What I would like is to have an afterUpdate line somewhere that will make this work without me having to click RefreshAll Button (which a truly love by the way, I click on this button so much for all sorts of reasons that the paint on it is starting to wear out. :o)
Jan 12 '10 #18

nico5038
Expert 2.5K+
P: 3,072
OK, I'll return to my previous solution, try to add in the close event or the AfterInsert event of the popup subform:
Expand|Select|Wrap|Line Numbers
  1. [Forms]![WorkOrderF].Recordsource = [Forms]![WorkOrderF].Recordsource 
This should make sure that the mainform shows all records.

Nic;o)
Jan 12 '10 #19

100+
P: 158
Nope, no worky......

I petition that we should all sign a letter addressed to Microsoft asking them to create a function called RefreshTheDamForm :o)
Jan 12 '10 #20

nico5038
Expert 2.5K+
P: 3,072
Then the remaining option would be to drop the pop-up form and use a "normal" form to add the new row, e.g. by positioning the main form on a new record.
In the AfterInsert event of the mainform you can add the above mentioned trick for the requiry. That should certainly work.
I avoid pop up forms since I found out that they don't trigger events like "got focus" on the "launching form" :-(

Nic;o)
Jan 12 '10 #21

100+
P: 158
Am I the only one who has this sort of problem? I see so many videos and posts all over the net stating the same problem; has anyone ever vanquished Grundel yet?

Granted, 98% of these posts and videos don't deal with adding a new record, but how hard can it be to refresh in the background so when you return to your form you can start using the new record you just added? Do I sound Whinny?
Jan 12 '10 #22

100+
P: 158
I guess I will leave it alone and keep on using the RefreshAll button on the ribbon' I've wasted enough of your time and want to thank you for trying to help, you're cool.

Side from that do you know a code to write in my subform so it shows no records when it loads?
Jan 12 '10 #23

nico5038
Expert 2.5K+
P: 3,072
? Normally a subform is linked by the linkage fields and will show the appropriate records. Can't imagine why you would like to make these invisible...

Nic;o)
Jan 12 '10 #24

100+
P: 158
Well the main form is blank with no record showing when it loads but the subform is showing the first record in its record source. I would just like to have a blank form and subform when I open the main form.
Jan 13 '10 #25

100+
P: 158
OK I think I managed to get the database shrunked up so I wont get in any trouble from my employer. I hope that the zip file enclose will work too....?

The form to open is WorkorderF

the combo box that is giving me problem is on top
Attached Files
File Type: zip testdbase.zip (184.1 KB, 76 views)
Jan 13 '10 #26

nico5038
Expert 2.5K+
P: 3,072
The blank main form is probably cause by the "new record" you move to.

My approach is always to show first a main form with all Orders is a datasheet subform and I have "Action" buttons for Adding, updating, deleting, printing, etc. for the selected row.
Checkout my attached sample. This will make the unbound combobox obsolete and it allows the user to filter the orders with the right-click pop up as (s)he likes.

Nic;o)
Attached Files
File Type: zip Sample-Datasheet-Filter-ObjectAction-2000.zip (111.7 KB, 162 views)
Jan 13 '10 #27

100+
P: 158
I've looked it through and it is impressive work.

What I enclosed in my zip is bare bone, it is only the form with the combo box and related table and query which I created in order to show what I am having problem with specifically. All the other tools and views and function aren't showing and they all work. I just need to have this combo box working. people who use the database love the layout and are used to it so I don't really want to change anything.

Are you able to see the problem with the combo box why when you add a new record it doesn't show on the main form?
Jan 13 '10 #28

nico5038
Expert 2.5K+
P: 3,072
Will check it out tomorrow, it's here past midnight so I have to ZZZZZZZZzzzzzzzzzzzzzz :-)

Nic;o)
Jan 13 '10 #29

100+
P: 158
Have some great ZZzzzz Buddy, thanks a million from Victoria Canada
Jan 13 '10 #30

nico5038
Expert 2.5K+
P: 3,072
I've changed the working of the popup form to handle a Cancel and OK button.
When OK the WO form is filtered with the newly created WOID and thus the Tenant combo will remove the filter when selected.

Check it out and let me know or this is "workable" :-)

Nic;o)
Attached Files
File Type: zip testdbase_nico5038.zip (192.0 KB, 112 views)
Jan 13 '10 #31

100+
P: 158
I couldn't wait to try it as soon as I heard I had an email notification. I don't know if I am doing something wrong but nothing is working?????

I;ve saved it under another name and open it with and enabled the options but nothing seems to work???? The pop up form doesn't add new work order and I can't switch between one work order to the next???? I am also getting a few error message boxes here and there????

Is it me, or is it Memorex?
Jan 13 '10 #32

nico5038
Expert 2.5K+
P: 3,072
Hmm, strange, but perhaps a problem created by the A2010 beta version I use at the moment.
Can you try to save the database as a A2003 .mdb and run that ?

Nic;o)
Jan 13 '10 #33

NeoPa
Expert Mod 15k+
P: 31,487
Is it possible it's simply a problem with some code not running due to security settings? Have you traced through the code to see what's happening?

See Debugging in VBA for further help with that.
Jan 13 '10 #34

100+
P: 158
I don't think I need to save it under an other version. I run 2007 and what I've noticed is similar to what I've seen before while trying a similar setup. I noticed that you added the line "requery" in the macro of the combobox and this basically doesn't work as I 've tried it several hundred different ways before lol. there are time when you can actually see the sheet wanting to call out the real related record and for a millisecond it appears but then flash back to the wrong record.
Jan 13 '10 #35

100+
P: 158
I just thought of something.....

I don't know if it is possible but can all my little problems that I have had here and there at one time or another be caused because I have a lemon version of Access 2007? what if all along the first line of code you gave me should have worked but didn't because I operate a lemon, is that possible in the computer world?
Jan 13 '10 #36

100+
P: 158
There is something that I've never seen before though:
Expand|Select|Wrap|Line Numbers
  1. _AXL:<?xml version="1.0" encoding="UTF-16" standalone="no"?>
  2. <UserInterfaceMacro For="TenantCombo" Event="AfterUpdate" xmlns="http://schemas.microsoft.com/office/accessservices/2009/04/application" xmlns:a="http://schemas.microsoft.com/office/accessser
  3.  
  4. _AXL:vices/2009/04/forms"><Statements><Action Name="SearchForRecord"><Argument Name="WhereCondition">="[Tenant] = " &amp; "'" &amp; [Screen].[ActiveControl] &amp; "'"</Argument></Action><Action Name="Requery"><Argument Name="ControlName">tenantCombo</Ar
  5.  
  6. _AXL:gument></Action><Action Name="RunMenuCommand"><Argument Name="Command">RemoveFilterSort</Argument></Action></Statements></UserInterfaceMacro>
  7.  
These lines were in the Comment column of the macro of the combo box and didn't lined up with the macro command line. what are those codes?
Jan 13 '10 #37

100+
P: 158
Update

Ok I've played around a bit with what you sent me and I finally managed to get the new record created in the popup to actually show in work order form while using the [ok] button and codes.

so this issue is resolved.

New issue: Filtering

After I've entered information in the newly created record my combox doesn't work for any other records. If I change work order from the combobox nothing happen but if I close the work order form and then reload it everything is as it should be. We are getting really close to solve this puppy my new best friend
Jan 13 '10 #38

nico5038
Expert 2.5K+
P: 3,072
I get the impression that your Access installation got corrupted in some way.
The not running of my sample and the XML in the comment are odd.

Please do a repair with the Control panel/Programs tool, or reinstall Office.

Perhaps also advisable to convert all macro's into VBA and stop using a mix of VBA and macro's. Macro's were already advised to ignore in the older versions and VBA gives much more flexibility.

In my version I added the "RemoveFilterSort" command in the afterupdate macro of the tenant combobox, as the popup form does add a filter to make the new recors to show.

Nic;o)
Jan 13 '10 #39

100+
P: 158
Thanks a million for helping me with this problem Nico.... Sure nice to have a system that works as it should.

Cheers
Jan 15 '10 #40

nico5038
Expert 2.5K+
P: 3,072
Glad I could help, success with the aplication !

Nic;o)
Jan 15 '10 #41

Post your reply

Sign in to post your reply or Sign up for a free account.