28. juni 2007 - 11:53Der er
8 kommentarer og 1 løsning
Sendkeys til en form og et felt
Hej,
Har en kalender hvor man kan ska välge dato. Hvordan sender jeg det til en form og et specifikt felt? Har en "ok" og en "Avbryt" knap.
Jeg har fundet nedenstående men ved ikke hvordan jeg får det at virke. --- Private Sub cmdOk_Click() On Error Resume Next Me.Visible = False If varType(Screen.ActiveControl.Value) = vbDate Then Screen.ActiveControl = Me.Kalender Else SendKeys Me.Kalender End If DoCmd.Close acForm, Me.Name End Sub
The way I normally use the calendar is to have a global (public variable) which is used to hold the selected date.
For each field which is used for entering dates I either use the double click event in the field or have a button beside the field which opens the form with the calendar control on it.
In the calendar form I put the chosen date into the global variable. Then when I return to the code which opens the calendar form I can now take the global variable and put it in the appropriate field.
He he! The points are yours :-) I will send you the DB. Please confirm that you reciev it!
Look at the form 'frmBrevbokning', there is a button between the field "Förfallodag" wich opens 'frmKalender'. I want to be able to select a date, and then send it to any form. In 'frmKalender' there is a button "Ok" (+ Avbryt/Cancel) and i want it to send the date back to 'frmBrevbokning' BUT i also want to have a third button in 'frmKalender' and when i click that button i want it to open another form, that i havent made yet, and send it to a field in that form. Is this possible?
The thing is that i need that to 1: Just send the value back to the form where i clicked the button. 2: When i have clicked the button and the frmKalender is open i would like a third button in frmKalender that will send it to a new form, this new form will be a reminder form where the user can type a text and then be reminded that specific date.
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.