I have a form based on a query, it loads all the fields with data from last record.
How can you have these fileds clear when the form load?
Also how do you "compile" this database into an exe, so that it can be run on a machine without access.
function clearform(cancel as integer)
Dim Clear
Me.fieldname1 = clear
Me.fieldname2 = clear
Me.fieldname3 = clear
'and so on
end function
If the fields are all named numericly, you could just increment it like this. This is assuming the fields are named numbericly (with a number at the end) you pass in the number of fileds that are in the record.
Private Sub Form_Load()
call clearform(20) 'this assumes there are 20 fields
end sub
Function Clearform(FormFields as Integer) ' limit of 30k fields. if more than 30k use "formfields as long"
Dim clear
Dim Fieldname as string
Do until formfields = 0
fieldname = "ThisIstheNameoftheFieldonTheForm" & formfilelds
me.fieldname = clear
formfields = formfields-1
Loop
EndFunction
However if you have the developer version of Microsoft Office then you can use it to install the Access runtime libraries onto each machine and then you can run it without having Access installed.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.