Pozdrav....
Pokusavam napravit 'dinamicku' formu koja ce kreirati prizvoljan broj TextBox kontrola na formi i poslije obrade, prilikom zatvaranja forme trebam te TextBox-ove obrisati...Ono sto je problem je brisanje...ja sam napisao sledecu proceduru koja bi trebala da uradi brisanje i koja je to i radila ali, ne lezi vraze, Access je narasno poceo da prijavljuje gresku. Svi savjeti su dobro dosli....
Tekst reske je:
The expression On Click you entered as the event property setting produced the following error: A problem occured while Microsoft Access was communicating with the OLE server or ActiveX Control.
*The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro.
This error occurs when an event has failed to run because the location of the logic for the event cannot be evaluated. For example, if the OnOpen property of a form is set to =[Field], this error occurs because a macro or event name is expected to run when the event occurs.
Ovo je procedura:
Private Sub cmdCloseTimeSheet_Click()
Dim i As Integer
Dim ctrs As Controls
Dim frm As Form
DoCmd.OpenForm "frmTimeSheet", acDesign
Set frm = Forms!frmTimeSheet
Set ctrs = frm.Controls
For i = ctrs.Count - 1 To 1 Step -1
If TypeName(ctrs.Item(i)) = "TextBox" Then
DeleteControl "frmTimeSheet", ctrs.Item(i).Name
End If
Next i
DoCmd.Close acForm, "frmTimeSheet", acSaveYes
End Sub