22. december 2003 - 10:19Der er
16 kommentarer og 2 løsninger
Formular opdater 5 felters værdi i eet felt afhængigt af fokus
Hejsa,
Emne: "Publish/Subscripe mellem felter på form", helst uden at flytte fokus.
Jeg har 4 felter, hvor en bruger indtaster forskellig information. Enhver indtastning i ét af de fire felter vil jeg gerne have kopieret over i et samlet "søgefelt", hvorfra en søgning kan foregår, hvis brugeren klikker på "søg". Hvordan overfører jeg løbende ændringer a la "on change", men uden at flytte fokus fra feltet, hvor inddateringen foregår. Jeg prøver at arbejde med en public variabel på min form, som ændres "on change", men jeg vil gerne knytte et felt på min form op mod denne variable, uden fokus - kan man det?
Udfordringen er at jeg har klistret et sæt events på de forskellige felter, så jeg vil gerne kunne undgå at forlade et felt, fordi hvis jeg påny sætter fokus, så kører en række events.
I dette særtema ser vi på, hvordan cloud og AI bliver fundamentet for virksomhedernes digitale forretning, og hvordan de nye muligheder for automatisering og forretningsværdi kan udnyttes uden at miste overblik, sikkerhed og menneskelig kontrol.
Hvis du på on change bruger noget i stil med Me.txtSearch = Me.txtField1 & Me.txtField2 & Me.txtField3 & Me.txtField4 så burde det ikke flytte rundt på din focus.
Sorry for not replying - accidently I did not notice that with the new layout of Hotmail (which is my eksperten account) I need to go to "mail", in case a message arrives from someone not on the contact list. So I thought nobody had answered...
I was thinking of having the "search" field like a shaded field, ready for searching for whatever was in this field - and it should not aggregate the sum of the 4 fields, but remove what was in the field previously and copy the value of the field I am currently focusing on: Like this.
1. I start typing customers phone number and as I type the digits 123, the searchfield shows 123, clicking the search will trigger that the value is from the phone-field, and do a "like" search in phone numbers. NOT clicking the search, but instead finish the phone number and move on to next field (e.g. spare part name) I start typing a part of the spare part name like Nvidia, which is then shown in the searchfield. If I click search, it will do a search within spare parts. The reason I have added the extra field is to let the user see what is being searched in, but also to let the user modify the search criteria without interfiering with the input frame - so after seing "nVidia" in the search field on a grey background, he might focus on the search field (background = white) and add info to that field like "Geforce", so that the Search field will read nVidia Geforce. Now the search will split the words and search via SQL for all spare parts with "nVidia" AND "Geforce" in their name.
To sum up: Can I do a "publish/subscribe" service within VBA?
Terry - where do you place your sFilter code - on the form itself?
Hugo: I will try and see if the onChange is ready for this without interfering, but often I seem to get errors like: " this cannot be done without the property having focus" - kind of messages thrown at me...
I will get back after having tested your suggestions. Have a merry (offline) christmas - I will try to spend time with my family myself :-)
I dnt know if you have tried accepting my anwer if you have can you drop acomment and I will try contacting admin as I have a feeling there is a problem!
Ahh.... My mistake. I didn't see it as a listbox, but simply as a name that was already selected. In XP with only one person answering, then the listbox layout is well hidden. So I didn't select you on the list, but simply pressed accept - so I have done 4 times now, but the last time, of course I checked that the answer was in fact accepted, which I didn't do in the first cases. But now it's done. A suggestion to Eksperten would be to automatically select the person, if only 1 has replied with answers?
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.